Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessor ¶
type Accessor interface { Metadata() Metadata // Create // // # Behavior // - Input path MUST match with object.ObjectMode, WITHOUT checking ObjectMode. // - Creating on existing dir SHOULD succeed. // - Creating on existing file SHOULD overwrite and truncate. Create(ctx context.Context, path string, args options.CreateOptions) error // Read returns [io.ReadCloser] if operation succeeded // // # Behavior // - Input path MUST match with object.ObjectMode, WITHOUT checking ObjectMode. Read(ctx context.Context, path string, args options.ReadOptions) (io.ReadCloser, error) // Write returns written size if operation succeeded // // # Behavior // - Input path MUST be file path, WITHOUT checking ObjectMode. Write(ctx context.Context, path string, args options.WriteOptions, reader io.ReadSeeker) (uint64, error) // Stat // // - Stat an empty path means stat provider's root path. // - Stat a path ends-with "/" means stating a dir. // - `mode` and `content_length` must be set. Stat(ctx context.Context, path string, args options.StatOptions) (ObjectMetadata, error) // Delete // // # Behavior // // - it is an idempotent operation, it's safe to call `Delete` on the same path multiple times. // - it SHOULD return nil if the path is deleted successfully or not exist. Delete(ctx context.Context, path string, args options.DeleteOptions) error // List // // # Behavior // // - Input path MUST be dir path, DON'T NEED to check ObjectMode. // - List non-exist dir should return Empty. List(ctx context.Context, path string, args options.ListOptions) (ObjectStream, error) // PreSign // // # Behavior // // - Requires capability: `PreSign` // - This API is optional, throws errors.ErrUnsupportedMethod if not supported. PreSign(ctx context.Context, path string, args options.PreSignOptions) (*http.Request, error) // CreateMultipart // // # Behavior // // - Requires capability: `Multipart` // - This op returns a `upload_id` which is required to for following APIs. CreateMultipart(ctx context.Context, path string, args options.CreateMultipart) (string, error) // WriteMultipart // // # Behavior // // - Requires capability: `Multipart` WriteMultipart(ctx context.Context, path string, args options.WriteMultipart, reader io.ReadSeeker) (ObjectPart, error) // CompleteMultipart // # Behavior // // - Requires capability: `Multipart` CompleteMultipart(ctx context.Context, path string, args options.CompleteMultipart) error // AbortMultipart // # Behavior // // - Requires capability: `Multipart` AbortMultipart(ctx context.Context, path string, args options.AbortMultipart) error }
type Capability ¶
type Capability uint8
const ( // Read `read` and `stat` Read Capability = 1 << iota // Write `write` and `delete` Write // List `list` List // PreSign `preSign` PreSign // Multipart `multipart` Multipart // Blocking `blocking` Blocking )
func (Capability) CapString ¶ added in v0.0.2
func (c Capability) CapString() string
func (Capability) Has ¶
func (c Capability) Has(capabilities ...Capability) bool
func (Capability) String ¶ added in v0.0.2
func (c Capability) String() string
type Entry ¶
type Entry interface { Accessor() Accessor Path() string Metadata() ObjectMetadata IsComplete() bool }
type Metadata ¶
type Metadata interface { Provider() Provider Root() string Name() string Capability() Capability String() string }
type ObjectMetadata ¶
type ObjectMode ¶
type ObjectMode int8
const ( Unknown ObjectMode = iota FILE DIR )
func ObjectModeFromPath ¶
func ObjectModeFromPath(path string) ObjectMode
func (ObjectMode) IsDir ¶
func (m ObjectMode) IsDir() bool
func (ObjectMode) IsFile ¶
func (m ObjectMode) IsFile() bool
func (ObjectMode) String ¶
func (m ObjectMode) String() string
type ObjectPageStream ¶
type ObjectPart ¶
type ObjectStream ¶
Click to show internal directories.
Click to hide internal directories.