Versions in this module Expand all Collapse all v0 v0.1.0 Sep 23, 2020 Changes in this version + const DefaultLocalCreatePathMode + const StatAttrsErrors + const StatAttrsTotal + const StatCreateErrors + const StatCreateTotal + const StatDeleteErrors + const StatDeleteTotal + const StatOpenErrors + const StatOpenTotal + const StatURLErrors + const StatURLTotal + var ErrCredentialsMissing = errors.New("credentials missing") + var ErrNotImplemented = errors.New("not implemented") + var LocalCreatePathMode = DefaultLocalCreatePathMode + func Exists(ctx context.Context, fs FS, path string) bool + func IsNotExist(err error) bool + func List(ctx context.Context, w Walker, path string) ([]string, error) + func NewMockFS() *mockFS + func Read(ctx context.Context, fs FS, path string, options *ReaderOptions) ([]byte, error) + func WalkN(ctx context.Context, w Walker, path string, n int, fn WalkFn) error + func Write(ctx context.Context, fs FS, path string, data []byte, options *WriterOptions) error + type Attributes struct + ContentType string + CreationTime time.Time + Metadata map[string]string + ModTime time.Time + Size int64 + type CacheOptions struct + DefaultExpired bool + MaxAge time.Duration + NoData bool + type FS interface + Attributes func(ctx context.Context, path string, options *ReaderOptions) (*Attributes, error) + Create func(ctx context.Context, path string, options *WriterOptions) (io.WriteCloser, error) + Delete func(ctx context.Context, path string) error + Open func(ctx context.Context, path string, options *ReaderOptions) (*File, error) + URL func(ctx context.Context, path string, options *SignedURLOptions) (string, error) + func FromURL(path string) FS + func NewCacheWrapper(src, cache FS, options *CacheOptions) FS + func NewCloudStorageFS(bucket string, credentials *google.Credentials) FS + func NewHashWrapper(h hash.Hash, fs FS, gs GetSetter) FS + func NewLocalFS(path string) FS + func NewLoggerWrapper(fs FS, name string, l Logger) FS + func NewMemoryFS() FS + func NewPrefixWrapper(fs FS, prefix string) FS + func NewS3FS(bucket string) FS + func NewSlowWrapper(fs FS, readDelay time.Duration, writeDelay time.Duration) FS + func NewStatsWrapper(fs FS, name string) FS + func NewTimeoutWrapper(fs FS, read time.Duration, write time.Duration) FS + func NewTraceWrapper(fs FS, name string) FS + type File struct + type GetSetter interface + Delete func(key string) error + Get func(key string) (string, error) + Set func(key string, value string) error + type Logger interface + Print func(v ...interface{}) + type ReaderOptions struct + type Scope int + const ScopeDelete + const ScopeRW + const ScopeRWD + const ScopeRead + const ScopeSignURL + const ScopeWrite + func ResolveCloudStorageScope(scope Scope) Scope + func (s Scope) Has(s2 Scope) bool + func (s Scope) String() string + type SignedURLOptions blob.SignedURLOptions + type WalkFn func(path string) error + type Walker interface + Walk func(ctx context.Context, path string, fn WalkFn) error + type WriterOptions struct + Attributes Attributes + BufferSize int