Browse Source

go fmt

pull/1699/head
Chris Lu 4 years ago
parent
commit
4f31c1bb94
  1. 2
      weed/filer/configuration.go
  2. 1
      weed/filer/filer_deletion.go
  3. 4
      weed/filer/filerstore_translate_path.go
  4. 8
      weed/filer/filerstore_wrapper.go
  5. 1
      weed/s3api/auth_credentials.go
  6. 1
      weed/s3api/s3_constants/s3_actions.go
  7. 2
      weed/storage/volume_loading.go

2
weed/filer/configuration.go

@ -68,7 +68,7 @@ func (f *Filer) LoadConfiguration(config *viper.Viper) {
if err := store.Initialize(config, key+"."); err != nil { if err := store.Initialize(config, key+"."); err != nil {
glog.Fatalf("Failed to initialize store for %s: %+v", key, err) glog.Fatalf("Failed to initialize store for %s: %+v", key, err)
} }
location := config.GetString(key+".location")
location := config.GetString(key + ".location")
if location == "" { if location == "" {
glog.Errorf("path-specific filer store needs %s", key+".location") glog.Errorf("path-specific filer store needs %s", key+".location")
os.Exit(-1) os.Exit(-1)

1
weed/filer/filer_deletion.go

@ -151,4 +151,3 @@ func (f *Filer) deleteChunksIfNotNew(oldEntry, newEntry *Entry) {
} }
f.DeleteChunks(toDelete) f.DeleteChunks(toDelete)
} }

4
weed/filer/filerstore_translate_path.go

@ -30,7 +30,7 @@ func NewFilerStorePathTranlator(storeRoot string, store FilerStore) *FilerStoreP
} }
} }
func (t *FilerStorePathTranlator) translatePath(fp util.FullPath) (newPath util.FullPath){
func (t *FilerStorePathTranlator) translatePath(fp util.FullPath) (newPath util.FullPath) {
newPath = fp newPath = fp
if t.storeRoot == "/" { if t.storeRoot == "/" {
return return
@ -41,7 +41,7 @@ func (t *FilerStorePathTranlator) translatePath(fp util.FullPath) (newPath util.
} }
return return
} }
func (t *FilerStorePathTranlator) changeEntryPath(entry *Entry) (previousPath util.FullPath){
func (t *FilerStorePathTranlator) changeEntryPath(entry *Entry) (previousPath util.FullPath) {
previousPath = entry.FullPath previousPath = entry.FullPath
if t.storeRoot == "/" { if t.storeRoot == "/" {
return return

8
weed/filer/filerstore_wrapper.go

@ -183,7 +183,7 @@ func (fsw *FilerStoreWrapper) DeleteOneEntry(ctx context.Context, existingEntry
} }
func (fsw *FilerStoreWrapper) DeleteFolderChildren(ctx context.Context, fp util.FullPath) (err error) { func (fsw *FilerStoreWrapper) DeleteFolderChildren(ctx context.Context, fp util.FullPath) (err error) {
actualStore := fsw.getActualStore(fp+"/")
actualStore := fsw.getActualStore(fp + "/")
stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "deleteFolderChildren").Inc() stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "deleteFolderChildren").Inc()
start := time.Now() start := time.Now()
defer func() { defer func() {
@ -195,7 +195,7 @@ func (fsw *FilerStoreWrapper) DeleteFolderChildren(ctx context.Context, fp util.
} }
func (fsw *FilerStoreWrapper) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int) ([]*Entry, error) { func (fsw *FilerStoreWrapper) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int) ([]*Entry, error) {
actualStore := fsw.getActualStore(dirPath+"/")
actualStore := fsw.getActualStore(dirPath + "/")
stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "list").Inc() stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "list").Inc()
start := time.Now() start := time.Now()
defer func() { defer func() {
@ -215,7 +215,7 @@ func (fsw *FilerStoreWrapper) ListDirectoryEntries(ctx context.Context, dirPath
} }
func (fsw *FilerStoreWrapper) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) ([]*Entry, error) { func (fsw *FilerStoreWrapper) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) ([]*Entry, error) {
actualStore := fsw.getActualStore(dirPath+"/")
actualStore := fsw.getActualStore(dirPath + "/")
stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "prefixList").Inc() stats.FilerStoreCounter.WithLabelValues(actualStore.GetName(), "prefixList").Inc()
start := time.Now() start := time.Now()
defer func() { defer func() {
@ -237,7 +237,7 @@ func (fsw *FilerStoreWrapper) ListDirectoryPrefixedEntries(ctx context.Context,
} }
func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) (entries []*Entry, err error) { func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) (entries []*Entry, err error) {
actualStore := fsw.getActualStore(dirPath+"/")
actualStore := fsw.getActualStore(dirPath + "/")
entries, err = actualStore.ListDirectoryEntries(ctx, dirPath, startFileName, includeStartFile, limit) entries, err = actualStore.ListDirectoryEntries(ctx, dirPath, startFileName, includeStartFile, limit)
if err != nil { if err != nil {
return nil, err return nil, err

1
weed/s3api/auth_credentials.go

@ -79,7 +79,6 @@ func (iam *IdentityAccessManagement) loadS3ApiConfigurationFromBytes(content []b
return nil return nil
} }
func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3ApiConfiguration) error { func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3ApiConfiguration) error {
var identities []*Identity var identities []*Identity
for _, ident := range config.Identities { for _, ident := range config.Identities {

1
weed/s3api/s3_constants/s3_actions.go

@ -7,4 +7,3 @@ const (
ACTION_TAGGING = "Tagging" ACTION_TAGGING = "Tagging"
ACTION_LIST = "List" ACTION_LIST = "List"
) )

2
weed/storage/volume_loading.go

@ -92,7 +92,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
if err == nil && alsoLoadIndex { if err == nil && alsoLoadIndex {
// adjust for existing volumes with .idx together with .dat files // adjust for existing volumes with .idx together with .dat files
if v.dirIdx != v.dir { if v.dirIdx != v.dir {
if util.FileExists(v.DataFileName()+".idx") {
if util.FileExists(v.DataFileName() + ".idx") {
v.dirIdx = v.dir v.dirIdx = v.dir
} }
} }

Loading…
Cancel
Save