diff --git a/etcd/fs/fs.go b/etcd/fs/fs.go index df3d9420..d716b70e 100644 --- a/etcd/fs/fs.go +++ b/etcd/fs/fs.go @@ -47,6 +47,9 @@ func init() { } const ( + // Scheme is the unique name for this filesystem type. + Scheme = "etcdfs" + // EtcdTimeout is the timeout to wait before erroring. EtcdTimeout = 5 * time.Second // FIXME: chosen arbitrarily // DefaultDataPrefix is the default path for data storage in etcd. @@ -331,7 +334,7 @@ func (obj *Fs) find(absPath string) (*File, error) { // TODO: function naming? } // Name returns the name of this filesystem. -func (obj *Fs) Name() string { return "etcdfs" } +func (obj *Fs) Name() string { return Scheme } // URI returns a URI representing this particular filesystem. func (obj *Fs) URI() string { diff --git a/etcd/world.go b/etcd/world.go index aa467174..6427c3c4 100644 --- a/etcd/world.go +++ b/etcd/world.go @@ -191,7 +191,7 @@ func (obj *World) Fs(uri string) (engine.Fs, error) { return obj.StandaloneFs, nil } - if u.Scheme != "etcdfs" { + if u.Scheme != etcdfs.Scheme { return nil, fmt.Errorf("unknown scheme: `%s`", u.Scheme) } if u.Path == "" {