Documentation
¶
Overview ¶
Package local provides a filesystem-backed Store implementation with no cloud SDK dependencies.
Index ¶
- type Config
- type Store
- func (s *Store) CopyFile(req *stores.CopyObjectRequest) error
- func (s *Store) CreateBucket(req *stores.CreateBucketRequest) error
- func (s *Store) Delete(key string) error
- func (s *Store) DeleteBucket(bucket string) error
- func (s *Store) DeleteFile(bucket, key string) error
- func (s *Store) Exists(key string) (bool, error)
- func (s *Store) GetAPIRequestStats(req *stores.APIStatsRequest) (*stores.APIStatsResponse, error)
- func (s *Store) GetBucketDomains(bucket string) ([]string, error)
- func (s *Store) GetBucketInfo(bucket string) (*stores.BucketInfo, error)
- func (s *Store) GetBucketStats(bucket string) (*stores.BucketStats, error)
- func (s *Store) GetCDNStats(req *stores.CDNStatsRequest) (*stores.CDNStatsResponse, error)
- func (s *Store) GetFileInfo(bucket, key string) (*stores.FileInfo, error)
- func (s *Store) GetFileURL(bucket, key string, expires time.Duration) (string, error)
- func (s *Store) GetOriginFetchStats(req *stores.OriginStatsRequest) (*stores.OriginStatsResponse, error)
- func (s *Store) ListBuckets(req *stores.ListBucketsRequest) (*stores.ListBucketsResponse, error)
- func (s *Store) ListFiles(bucket string, req *stores.ListFilesRequest) (*stores.ListFilesResponse, error)
- func (s *Store) MoveFile(req *stores.CopyObjectRequest) error
- func (s *Store) PublicURL(key string) string
- func (s *Store) Read(key string) (io.ReadCloser, int64, error)
- func (s *Store) SetBucketPrivate(bucket string, isPrivate bool) error
- func (s *Store) UploadFile(bucket, key string, reader io.Reader, size int64) error
- func (s *Store) Write(key string, r io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements stores.Store using the local filesystem. It also implements stores.ObjectStorageManager for bucket & object management (see manager.go).
func (*Store) CopyFile ¶ added in v0.1.1
func (s *Store) CopyFile(req *stores.CopyObjectRequest) error
CopyFile copies an object within or across local buckets.
func (*Store) CreateBucket ¶ added in v0.1.1
func (s *Store) CreateBucket(req *stores.CreateBucketRequest) error
CreateBucket creates a new local bucket (directory + metadata).
func (*Store) DeleteBucket ¶ added in v0.1.1
DeleteBucket deletes an empty local bucket.
func (*Store) DeleteFile ¶ added in v0.1.1
DeleteFile deletes an object from a local bucket.
func (*Store) GetAPIRequestStats ¶ added in v0.1.2
func (s *Store) GetAPIRequestStats(req *stores.APIStatsRequest) (*stores.APIStatsResponse, error)
GetAPIRequestStats is not supported by the local filesystem backend.
func (*Store) GetBucketDomains ¶ added in v0.1.1
GetBucketDomains returns the domain names bound to a local bucket.
func (*Store) GetBucketInfo ¶ added in v0.1.1
func (s *Store) GetBucketInfo(bucket string) (*stores.BucketInfo, error)
GetBucketInfo returns metadata about a local bucket.
func (*Store) GetBucketStats ¶ added in v0.1.2
func (s *Store) GetBucketStats(bucket string) (*stores.BucketStats, error)
GetBucketStats walks the bucket directory and returns the total size and object count. For the local store, "bucket" maps to a subdirectory under the root; an empty bucket uses the root itself.
func (*Store) GetCDNStats ¶ added in v0.1.2
func (s *Store) GetCDNStats(req *stores.CDNStatsRequest) (*stores.CDNStatsResponse, error)
GetCDNStats is not supported by the local filesystem backend.
func (*Store) GetFileInfo ¶ added in v0.1.1
GetFileInfo returns metadata for a single object.
func (*Store) GetFileURL ¶ added in v0.1.1
GetFileURL returns a URL for accessing an object. For local stores this is a relative path; the expires parameter is ignored.
func (*Store) GetOriginFetchStats ¶ added in v0.1.2
func (s *Store) GetOriginFetchStats(req *stores.OriginStatsRequest) (*stores.OriginStatsResponse, error)
GetOriginFetchStats is not supported by the local filesystem backend.
func (*Store) ListBuckets ¶ added in v0.1.1
func (s *Store) ListBuckets(req *stores.ListBucketsRequest) (*stores.ListBucketsResponse, error)
ListBuckets lists all local buckets.
func (*Store) ListFiles ¶ added in v0.1.1
func (s *Store) ListFiles(bucket string, req *stores.ListFilesRequest) (*stores.ListFilesResponse, error)
ListFiles lists objects in a local bucket.
func (*Store) MoveFile ¶ added in v0.1.1
func (s *Store) MoveFile(req *stores.CopyObjectRequest) error
MoveFile moves an object within or across local buckets.
func (*Store) SetBucketPrivate ¶ added in v0.1.1
SetBucketPrivate sets the access control of a local bucket.
func (*Store) UploadFile ¶ added in v0.1.1
UploadFile uploads data to a local bucket.