refactoring

This commit is contained in:
Chris Lu
2020-11-15 14:41:56 -08:00
parent 590f02179d
commit 500bcab953
6 changed files with 82 additions and 41 deletions

View File

@@ -51,7 +51,6 @@ func (fc *FilerConf) loadFromChunks(filer *Filer, chunks []*filer_pb.FileChunk)
return fc.loadFromBytes(data)
}
func (fc *FilerConf) loadFromBytes(data []byte) (err error) {
conf := &filer_pb.FilerConf{}
err = proto.UnmarshalText(string(data), conf)

View File

@@ -0,0 +1,16 @@
package filer
import "github.com/chrislusf/seaweedfs/weed/storage/needle"
type StorageOption struct {
Replication string
Collection string
DataCenter string
Rack string
TtlSeconds int32
Fsync bool
}
func (so *StorageOption) TtlString() string {
return needle.SecondsToTTL(so.TtlSeconds)
}