Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunks ¶
type Chunks interface {
Chunk() (*listObjectResult, error)
}
Chunks is used to get the next "page" of objects.
type File ¶
type File interface { // Key is the object key. Key() string // Type is the object type. Type() string // Size is the size of current file. Size() int64 // ETag is etag return by cloud storage providers. ETag() string // LastModified is the time when the object was last updated. LastModified() time.Time }
File A slice of File is returned when all files are fetched through Store.Files. File hides differences in object returns from different cloud storage providers, but at the same time, it can only return less information.
type FileIterator ¶
FileIterator is an iterator used to iterate over all objects in the cloud.
type Store ¶
type Store interface { // Put saves the content read from r to the key of oss. Put(key string, r io.Reader) error // PutFromFile saves the file pointed to by the `localPath` to the oss key. PutFromFile(key string, localPath string) error // Get gets the file pointed to by key. Get(key string) (io.ReadCloser, error) // GetString gets the file pointed to by key and returns a string. GetString(key string) (string, error) // GetBytes gets the file pointed to by key and returns a byte array. GetBytes(key string) ([]byte, error) // GetToFile saves the file pointed to by key to the localPath. GetToFile(key string, localPath string) error // Delete the file pointed to by key. Delete(key string) error // Exists determines whether the file exists. Exists(key string) (bool, error) // Files list all files in the specified directory. Files(dir string) ([]File, error) // Size fet the file size. Size(key string) (int64, error) }
Store defines a unified interface for reading and writing cloud storage objects.
Click to show internal directories.
Click to hide internal directories.