Documentation ¶
Overview ¶
Package types intends to provide all types used in storage layer.
Code generated by go generate cmd/definitions; DO NOT EDIT.
Code generated by go generate cmd/definitions; DO NOT EDIT.
Code generated by go generate cmd/definitions; DO NOT EDIT.
Code generated by go generate cmd/definitions; DO NOT EDIT.
Index ¶
- Variables
- func NewOperationNotImplementedError(op string) error
- type Appenderdeprecated
- type Block
- type BlockIterator
- type BlockPage
- type Blockerdeprecated
- type Continuable
- type Copierdeprecated
- type DefaultServicePairs
- type DefaultStoragePairs
- type Direrdeprecated
- type Fetcherdeprecated
- type Interceptor
- type Linkerdeprecated
- type ListMode
- type Moverdeprecated
- type MultipartHTTPSignerdeprecated
- type Multiparterdeprecated
- type NextBlockFunc
- type NextObjectFunc
- type NextPartFunc
- type NextStoragerFunc
- type Object
- func (o *Object) GetAppendOffset() (int64, bool)
- func (o *Object) GetContentDisposition() (string, bool)
- func (o *Object) GetContentLength() (int64, bool)
- func (o *Object) GetContentMd5() (string, bool)
- func (o *Object) GetContentType() (string, bool)
- func (o *Object) GetEtag() (string, bool)
- func (o *Object) GetID() string
- func (o *Object) GetLastModified() (time.Time, bool)
- func (o *Object) GetLinkTarget() (string, bool)
- func (o *Object) GetMode() ObjectMode
- func (o *Object) GetMultipartID() (string, bool)
- func (o *Object) GetPath() string
- func (o *Object) GetSystemMetadata() (interface{}, bool)
- func (o *Object) GetUserMetadata() (map[string]string, bool)
- func (o *Object) MustGetAppendOffset() int64
- func (o *Object) MustGetContentDisposition() string
- func (o *Object) MustGetContentLength() int64
- func (o *Object) MustGetContentMd5() string
- func (o *Object) MustGetContentType() string
- func (o *Object) MustGetEtag() string
- func (o *Object) MustGetLastModified() time.Time
- func (o *Object) MustGetLinkTarget() string
- func (o *Object) MustGetMultipartID() string
- func (o *Object) MustGetSystemMetadata() interface{}
- func (o *Object) MustGetUserMetadata() map[string]string
- func (o *Object) SetAppendOffset(v int64) *Object
- func (o *Object) SetContentDisposition(v string) *Object
- func (o *Object) SetContentLength(v int64) *Object
- func (o *Object) SetContentMd5(v string) *Object
- func (o *Object) SetContentType(v string) *Object
- func (o *Object) SetEtag(v string) *Object
- func (o *Object) SetID(v string) *Object
- func (o *Object) SetLastModified(v time.Time) *Object
- func (o *Object) SetLinkTarget(v string) *Object
- func (o *Object) SetMode(v ObjectMode) *Object
- func (o *Object) SetMultipartID(v string) *Object
- func (o *Object) SetPath(v string) *Object
- func (o *Object) SetSystemMetadata(v interface{}) *Object
- func (o *Object) SetUserMetadata(v map[string]string) *Object
- type ObjectIterator
- type ObjectMode
- func (o *ObjectMode) Add(mode ObjectMode)
- func (o *ObjectMode) Del(mode ObjectMode)
- func (o ObjectMode) IsAppend() bool
- func (o ObjectMode) IsBlock() bool
- func (o ObjectMode) IsDir() bool
- func (o ObjectMode) IsLink() bool
- func (o ObjectMode) IsPage() bool
- func (o ObjectMode) IsPart() bool
- func (o ObjectMode) IsRead() bool
- func (o ObjectMode) String() string
- type ObjectPage
- type OperationError
- type Pagerdeprecated
- type Pair
- type Part
- type PartIterator
- type PartPage
- type ServiceFeatures
- type Servicer
- type StorageFeatures
- type StorageHTTPSignerdeprecated
- type StorageMeta
- func (m *StorageMeta) GetAppendNumberMaximum() (int, bool)
- func (m *StorageMeta) GetAppendSizeMaximum() (int64, bool)
- func (m *StorageMeta) GetAppendTotalSizeMaximum() (int64, bool)
- func (m *StorageMeta) GetCopySizeMaximum() (int64, bool)
- func (m *StorageMeta) GetFetchSizeMaximum() (int64, bool)
- func (m *StorageMeta) GetLocation() (string, bool)
- func (m *StorageMeta) GetMoveSizeMaximum() (int64, bool)
- func (m *StorageMeta) GetMultipartNumberMaximum() (int, bool)
- func (m *StorageMeta) GetMultipartSizeMaximum() (int64, bool)
- func (m *StorageMeta) GetMultipartSizeMinimum() (int64, bool)
- func (m *StorageMeta) GetName() string
- func (m *StorageMeta) GetService() string
- func (m *StorageMeta) GetSystemMetadata() (interface{}, bool)
- func (m *StorageMeta) GetWorkDir() string
- func (m *StorageMeta) GetWriteSizeMaximum() (int64, bool)
- func (m *StorageMeta) MustGetAppendNumberMaximum() int
- func (m *StorageMeta) MustGetAppendSizeMaximum() int64
- func (m *StorageMeta) MustGetAppendTotalSizeMaximum() int64
- func (m *StorageMeta) MustGetCopySizeMaximum() int64
- func (m *StorageMeta) MustGetFetchSizeMaximum() int64
- func (m *StorageMeta) MustGetLocation() string
- func (m *StorageMeta) MustGetMoveSizeMaximum() int64
- func (m *StorageMeta) MustGetMultipartNumberMaximum() int
- func (m *StorageMeta) MustGetMultipartSizeMaximum() int64
- func (m *StorageMeta) MustGetMultipartSizeMinimum() int64
- func (m *StorageMeta) MustGetSystemMetadata() interface{}
- func (m *StorageMeta) MustGetWriteSizeMaximum() int64
- func (m *StorageMeta) SetAppendNumberMaximum(v int) *StorageMeta
- func (m *StorageMeta) SetAppendSizeMaximum(v int64) *StorageMeta
- func (m *StorageMeta) SetAppendTotalSizeMaximum(v int64) *StorageMeta
- func (m *StorageMeta) SetCopySizeMaximum(v int64) *StorageMeta
- func (m *StorageMeta) SetFetchSizeMaximum(v int64) *StorageMeta
- func (m *StorageMeta) SetLocation(v string) *StorageMeta
- func (m *StorageMeta) SetMoveSizeMaximum(v int64) *StorageMeta
- func (m *StorageMeta) SetMultipartNumberMaximum(v int) *StorageMeta
- func (m *StorageMeta) SetMultipartSizeMaximum(v int64) *StorageMeta
- func (m *StorageMeta) SetMultipartSizeMinimum(v int64) *StorageMeta
- func (m *StorageMeta) SetName(v string) *StorageMeta
- func (m *StorageMeta) SetService(v string) *StorageMeta
- func (m *StorageMeta) SetSystemMetadata(v interface{}) *StorageMeta
- func (m *StorageMeta) SetWorkDir(v string) *StorageMeta
- func (m *StorageMeta) SetWriteSizeMaximum(v int64) *StorageMeta
- type Storager
- type StoragerIterator
- type StoragerPage
- type UnimplementedAppenderdeprecated
- func (s UnimplementedAppender) CommitAppend(o *Object, pairs ...Pair) (err error)
- func (s UnimplementedAppender) CommitAppendWithContext(ctx context.Context, o *Object, pairs ...Pair) (err error)
- func (s UnimplementedAppender) CreateAppend(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedAppender) CreateAppendWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedAppender) String() string
- func (s UnimplementedAppender) WriteAppend(o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
- func (s UnimplementedAppender) WriteAppendWithContext(ctx context.Context, o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
- type UnimplementedBlockerdeprecated
- func (s UnimplementedBlocker) CombineBlock(o *Object, bids []string, pairs ...Pair) (err error)
- func (s UnimplementedBlocker) CombineBlockWithContext(ctx context.Context, o *Object, bids []string, pairs ...Pair) (err error)
- func (s UnimplementedBlocker) CreateBlock(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedBlocker) CreateBlockWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedBlocker) ListBlock(o *Object, pairs ...Pair) (bi *BlockIterator, err error)
- func (s UnimplementedBlocker) ListBlockWithContext(ctx context.Context, o *Object, pairs ...Pair) (bi *BlockIterator, err error)
- func (s UnimplementedBlocker) String() string
- func (s UnimplementedBlocker) WriteBlock(o *Object, r io.Reader, size int64, bid string, pairs ...Pair) (n int64, err error)
- func (s UnimplementedBlocker) WriteBlockWithContext(ctx context.Context, o *Object, r io.Reader, size int64, bid string, ...) (n int64, err error)
- type UnimplementedCopierdeprecated
- type UnimplementedDirerdeprecated
- type UnimplementedFetcherdeprecated
- type UnimplementedLinkerdeprecated
- type UnimplementedMoverdeprecated
- type UnimplementedMultipartHTTPSignerdeprecated
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPCompleteMultipart(o *Object, parts []*Part, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPCompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, expire time.Duration, ...) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPCreateMultipart(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPCreateMultipartWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPListMultipart(o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPListMultipartWithContext(ctx context.Context, o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPWriteMultipart(o *Object, size int64, index int, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) QuerySignHTTPWriteMultipartWithContext(ctx context.Context, o *Object, size int64, index int, expire time.Duration, ...) (req *http.Request, err error)
- func (s UnimplementedMultipartHTTPSigner) String() string
- type UnimplementedMultiparterdeprecated
- func (s UnimplementedMultiparter) CompleteMultipart(o *Object, parts []*Part, pairs ...Pair) (err error)
- func (s UnimplementedMultiparter) CompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, pairs ...Pair) (err error)
- func (s UnimplementedMultiparter) CreateMultipart(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedMultiparter) CreateMultipartWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedMultiparter) ListMultipart(o *Object, pairs ...Pair) (pi *PartIterator, err error)
- func (s UnimplementedMultiparter) ListMultipartWithContext(ctx context.Context, o *Object, pairs ...Pair) (pi *PartIterator, err error)
- func (s UnimplementedMultiparter) String() string
- func (s UnimplementedMultiparter) WriteMultipart(o *Object, r io.Reader, size int64, index int, pairs ...Pair) (n int64, part *Part, err error)
- func (s UnimplementedMultiparter) WriteMultipartWithContext(ctx context.Context, o *Object, r io.Reader, size int64, index int, ...) (n int64, part *Part, err error)
- type UnimplementedPagerdeprecated
- func (s UnimplementedPager) CreatePage(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedPager) CreatePageWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedPager) String() string
- func (s UnimplementedPager) WritePage(o *Object, r io.Reader, size int64, offset int64, pairs ...Pair) (n int64, err error)
- func (s UnimplementedPager) WritePageWithContext(ctx context.Context, o *Object, r io.Reader, size int64, offset int64, ...) (n int64, err error)
- type UnimplementedServicer
- func (s UnimplementedServicer) Create(name string, pairs ...Pair) (store Storager, err error)
- func (s UnimplementedServicer) CreateWithContext(ctx context.Context, name string, pairs ...Pair) (store Storager, err error)
- func (s UnimplementedServicer) Delete(name string, pairs ...Pair) (err error)
- func (s UnimplementedServicer) DeleteWithContext(ctx context.Context, name string, pairs ...Pair) (err error)
- func (s UnimplementedServicer) Features() (fe ServiceFeatures)
- func (s UnimplementedServicer) Get(name string, pairs ...Pair) (store Storager, err error)
- func (s UnimplementedServicer) GetWithContext(ctx context.Context, name string, pairs ...Pair) (store Storager, err error)
- func (s UnimplementedServicer) List(pairs ...Pair) (sti *StoragerIterator, err error)
- func (s UnimplementedServicer) ListWithContext(ctx context.Context, pairs ...Pair) (sti *StoragerIterator, err error)
- func (s UnimplementedServicer) String() string
- type UnimplementedStorageHTTPSignerdeprecated
- func (s UnimplementedStorageHTTPSigner) QuerySignHTTPDelete(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorageHTTPSigner) QuerySignHTTPDeleteWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorageHTTPSigner) QuerySignHTTPRead(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorageHTTPSigner) QuerySignHTTPReadWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorageHTTPSigner) QuerySignHTTPWrite(path string, size int64, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorageHTTPSigner) QuerySignHTTPWriteWithContext(ctx context.Context, path string, size int64, expire time.Duration, ...) (req *http.Request, err error)
- func (s UnimplementedStorageHTTPSigner) String() string
- type UnimplementedStorager
- func (s UnimplementedStorager) CombineBlock(o *Object, bids []string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) CombineBlockWithContext(ctx context.Context, o *Object, bids []string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) CommitAppend(o *Object, pairs ...Pair) (err error)
- func (s UnimplementedStorager) CommitAppendWithContext(ctx context.Context, o *Object, pairs ...Pair) (err error)
- func (s UnimplementedStorager) CompleteMultipart(o *Object, parts []*Part, pairs ...Pair) (err error)
- func (s UnimplementedStorager) CompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, pairs ...Pair) (err error)
- func (s UnimplementedStorager) Copy(src string, dst string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) CopyWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) Create(path string, pairs ...Pair) (o *Object)
- func (s UnimplementedStorager) CreateAppend(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateAppendWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateBlock(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateBlockWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateDir(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateDirWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateLink(path string, target string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateLinkWithContext(ctx context.Context, path string, target string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateMultipart(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreateMultipartWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreatePage(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) CreatePageWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) Delete(path string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) DeleteWithContext(ctx context.Context, path string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) Features() (fe StorageFeatures)
- func (s UnimplementedStorager) Fetch(path string, url string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) FetchWithContext(ctx context.Context, path string, url string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) List(path string, pairs ...Pair) (oi *ObjectIterator, err error)
- func (s UnimplementedStorager) ListBlock(o *Object, pairs ...Pair) (bi *BlockIterator, err error)
- func (s UnimplementedStorager) ListBlockWithContext(ctx context.Context, o *Object, pairs ...Pair) (bi *BlockIterator, err error)
- func (s UnimplementedStorager) ListMultipart(o *Object, pairs ...Pair) (pi *PartIterator, err error)
- func (s UnimplementedStorager) ListMultipartWithContext(ctx context.Context, o *Object, pairs ...Pair) (pi *PartIterator, err error)
- func (s UnimplementedStorager) ListWithContext(ctx context.Context, path string, pairs ...Pair) (oi *ObjectIterator, err error)
- func (s UnimplementedStorager) Metadata(pairs ...Pair) (meta *StorageMeta)
- func (s UnimplementedStorager) Move(src string, dst string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) MoveWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error)
- func (s UnimplementedStorager) QuerySignHTTPCompleteMultipart(o *Object, parts []*Part, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPCompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, expire time.Duration, ...) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPCreateMultipart(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPCreateMultipartWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPDelete(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPDeleteWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPListMultipart(o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPListMultipartWithContext(ctx context.Context, o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPRead(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPReadWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPWrite(path string, size int64, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPWriteMultipart(o *Object, size int64, index int, expire time.Duration, pairs ...Pair) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPWriteMultipartWithContext(ctx context.Context, o *Object, size int64, index int, expire time.Duration, ...) (req *http.Request, err error)
- func (s UnimplementedStorager) QuerySignHTTPWriteWithContext(ctx context.Context, path string, size int64, expire time.Duration, ...) (req *http.Request, err error)
- func (s UnimplementedStorager) Read(path string, w io.Writer, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) ReadWithContext(ctx context.Context, path string, w io.Writer, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) Stat(path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) StatWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error)
- func (s UnimplementedStorager) String() string
- func (s UnimplementedStorager) Write(path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) WriteAppend(o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) WriteAppendWithContext(ctx context.Context, o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) WriteBlock(o *Object, r io.Reader, size int64, bid string, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) WriteBlockWithContext(ctx context.Context, o *Object, r io.Reader, size int64, bid string, ...) (n int64, err error)
- func (s UnimplementedStorager) WriteMultipart(o *Object, r io.Reader, size int64, index int, pairs ...Pair) (n int64, part *Part, err error)
- func (s UnimplementedStorager) WriteMultipartWithContext(ctx context.Context, o *Object, r io.Reader, size int64, index int, ...) (n int64, part *Part, err error)
- func (s UnimplementedStorager) WritePage(o *Object, r io.Reader, size int64, offset int64, pairs ...Pair) (n int64, err error)
- func (s UnimplementedStorager) WritePageWithContext(ctx context.Context, o *Object, r io.Reader, size int64, offset int64, ...) (n int64, err error)
- func (s UnimplementedStorager) WriteWithContext(ctx context.Context, path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotImplemented will be returned while this operation is not // implemented by services. ErrNotImplemented = errorCode{"not implemented"} )
var IterateDone error = errorCode{"iterate is done"}
IterateDone means this iterator has returned all data.
Functions ¶
func NewOperationNotImplementedError ¶
NewOperationNotImplementedError will create a new NotImplemented error.
Types ¶
type Appender
deprecated
type Appender interface { // CommitAppend will commit and finish an append process. // // Deprecated: Moved to Storager. CommitAppend(o *Object, pairs ...Pair) (err error) // CommitAppendWithContext will commit and finish an append process. // // Deprecated: Moved to Storager. CommitAppendWithContext(ctx context.Context, o *Object, pairs ...Pair) (err error) // CreateAppend will create an append object. // // ## Behavior // // - CreateAppend SHOULD create an appendable object with position 0 and size 0. // - CreateAppend SHOULD NOT return an error as the object exist. // - Service SHOULD check and delete the object if exists. // // Deprecated: Moved to Storager. CreateAppend(path string, pairs ...Pair) (o *Object, err error) // CreateAppendWithContext will create an append object. // // ## Behavior // // - CreateAppend SHOULD create an appendable object with position 0 and size 0. // - CreateAppend SHOULD NOT return an error as the object exist. // - Service SHOULD check and delete the object if exists. // // Deprecated: Moved to Storager. CreateAppendWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // WriteAppend will append content to an append object. // // Deprecated: Moved to Storager. WriteAppend(o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error) // WriteAppendWithContext will append content to an append object. // // Deprecated: Moved to Storager. WriteAppendWithContext(ctx context.Context, o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error) // contains filtered or unexported methods }
Appender is the interface for Append related operations.
Deprecated: Moved to Storager.
type BlockIterator ¶
type BlockIterator struct {
// contains filtered or unexported fields
}
func NewBlockIterator ¶
func NewBlockIterator(ctx context.Context, next NextBlockFunc, status Continuable) *BlockIterator
func (*BlockIterator) ContinuationToken ¶
func (it *BlockIterator) ContinuationToken() string
func (*BlockIterator) Next ¶
func (it *BlockIterator) Next() (object *Block, err error)
type BlockPage ¶
type BlockPage struct { Status Continuable Data []*Block }
type Blocker
deprecated
type Blocker interface { // CombineBlock will combine blocks into an object. // // Deprecated: Moved to Storager. CombineBlock(o *Object, bids []string, pairs ...Pair) (err error) // CombineBlockWithContext will combine blocks into an object. // // Deprecated: Moved to Storager. CombineBlockWithContext(ctx context.Context, o *Object, bids []string, pairs ...Pair) (err error) // CreateBlock will create a new block object. // // ## Behavior // - CreateBlock SHOULD NOT return an error as the object exist. // - Service that has native support for `overwrite` doesn't NEED to check the object exists or not. // - Service that doesn't have native support for `overwrite` SHOULD check and delete the object if // exists. // // Deprecated: Moved to Storager. CreateBlock(path string, pairs ...Pair) (o *Object, err error) // CreateBlockWithContext will create a new block object. // // ## Behavior // - CreateBlock SHOULD NOT return an error as the object exist. // - Service that has native support for `overwrite` doesn't NEED to check the object exists or not. // - Service that doesn't have native support for `overwrite` SHOULD check and delete the object if // exists. // // Deprecated: Moved to Storager. CreateBlockWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // ListBlock will list blocks belong to this object. // // Deprecated: Moved to Storager. ListBlock(o *Object, pairs ...Pair) (bi *BlockIterator, err error) // ListBlockWithContext will list blocks belong to this object. // // Deprecated: Moved to Storager. ListBlockWithContext(ctx context.Context, o *Object, pairs ...Pair) (bi *BlockIterator, err error) // WriteBlock will write content to a block. // // Deprecated: Moved to Storager. WriteBlock(o *Object, r io.Reader, size int64, bid string, pairs ...Pair) (n int64, err error) // WriteBlockWithContext will write content to a block. // // Deprecated: Moved to Storager. WriteBlockWithContext(ctx context.Context, o *Object, r io.Reader, size int64, bid string, pairs ...Pair) (n int64, err error) // contains filtered or unexported methods }
Blocker is the interface for Block related operations.
Deprecated: Moved to Storager.
type Continuable ¶
type Continuable interface {
ContinuationToken() string
}
type Copier
deprecated
type Copier interface { // Copy will copy an Object or multiple object in the service. // // ## Behavior // // - Copy only copy one and only one object. // - Service DON'T NEED to support copy a non-empty directory or copy files recursively. // - User NEED to implement copy a non-empty directory and copy recursively by themself. // - Copy a file to a directory SHOULD return `ErrObjectModeInvalid`. // - Copy SHOULD NOT return an error as dst object exists. // - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or // not. // - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object // if exists. // - A successful copy opration should be complete, which means the dst object's content and metadata // should be the same as src object. // // Deprecated: Moved to Storager. Copy(src string, dst string, pairs ...Pair) (err error) // CopyWithContext will copy an Object or multiple object in the service. // // ## Behavior // // - Copy only copy one and only one object. // - Service DON'T NEED to support copy a non-empty directory or copy files recursively. // - User NEED to implement copy a non-empty directory and copy recursively by themself. // - Copy a file to a directory SHOULD return `ErrObjectModeInvalid`. // - Copy SHOULD NOT return an error as dst object exists. // - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or // not. // - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object // if exists. // - A successful copy opration should be complete, which means the dst object's content and metadata // should be the same as src object. // // Deprecated: Moved to Storager. CopyWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error) // contains filtered or unexported methods }
Copier is the interface for Copy.
Deprecated: Moved to Storager.
type DefaultServicePairs ¶
DefaultServicePairs is the default pairs for Service.
type DefaultStoragePairs ¶
type DefaultStoragePairs struct { CombineBlock []Pair CommitAppend []Pair CompleteMultipart []Pair Copy []Pair Create []Pair CreateAppend []Pair CreateBlock []Pair CreateDir []Pair CreateLink []Pair CreateMultipart []Pair CreatePage []Pair Delete []Pair Fetch []Pair List []Pair ListBlock []Pair ListMultipart []Pair Metadata []Pair Move []Pair QuerySignHTTPCompleteMultipart []Pair QuerySignHTTPCreateMultipart []Pair QuerySignHTTPDelete []Pair QuerySignHTTPListMultipart []Pair QuerySignHTTPRead []Pair QuerySignHTTPWrite []Pair QuerySignHTTPWriteMultipart []Pair Read []Pair Stat []Pair Write []Pair WriteAppend []Pair WriteBlock []Pair WriteMultipart []Pair WritePage []Pair }
DefaultStoragePairs is the default pairs for Storage.
type Direr
deprecated
type Direr interface { // CreateDir will create a new dir object. // // Deprecated: Moved to Storager. CreateDir(path string, pairs ...Pair) (o *Object, err error) // CreateDirWithContext will create a new dir object. // // Deprecated: Moved to Storager. CreateDirWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // contains filtered or unexported methods }
Direr is the interface for Directory.
Deprecated: Moved to Storager.
type Fetcher
deprecated
type Fetcher interface { // Fetch will fetch from a given url to path. // // ## Behavior // // - Fetch SHOULD NOT return an error as the object exists. // - A successful fetch operation should be complete, which means the object's content and metadata // should be the same as requiring from the url. // // Deprecated: Moved to Storager. Fetch(path string, url string, pairs ...Pair) (err error) // FetchWithContext will fetch from a given url to path. // // ## Behavior // // - Fetch SHOULD NOT return an error as the object exists. // - A successful fetch operation should be complete, which means the object's content and metadata // should be the same as requiring from the url. // // Deprecated: Moved to Storager. FetchWithContext(ctx context.Context, path string, url string, pairs ...Pair) (err error) // contains filtered or unexported methods }
Fetcher is the interface for Fetch.
Deprecated: Moved to Storager.
type Interceptor ¶
func ChainInterceptor ¶
func ChainInterceptor(interceptors ...Interceptor) Interceptor
type Linker
deprecated
type Linker interface { // CreateLink Will create a link object. // // # Behavior // // - `path` and `target` COULD be relative or absolute path. // - If `target` not exists, CreateLink will still create a link object to path. // - If `path` exists: // - If `path` is a symlink object, CreateLink will remove the symlink object and create a new link object // to path. // - If `path` is not a symlink object, CreateLink will return an ErrObjectModeInvalid error when // the service does not support overwrite. // - A link object COULD be returned in `Stat` or `List`. // - CreateLink COULD implement virtual_link feature when service without native support. // - Users SHOULD enable this feature by themselves. // // Deprecated: Moved to Storager. CreateLink(path string, target string, pairs ...Pair) (o *Object, err error) // CreateLinkWithContext Will create a link object. // // # Behavior // // - `path` and `target` COULD be relative or absolute path. // - If `target` not exists, CreateLink will still create a link object to path. // - If `path` exists: // - If `path` is a symlink object, CreateLink will remove the symlink object and create a new link object // to path. // - If `path` is not a symlink object, CreateLink will return an ErrObjectModeInvalid error when // the service does not support overwrite. // - A link object COULD be returned in `Stat` or `List`. // - CreateLink COULD implement virtual_link feature when service without native support. // - Users SHOULD enable this feature by themselves. // // Deprecated: Moved to Storager. CreateLinkWithContext(ctx context.Context, path string, target string, pairs ...Pair) (o *Object, err error) // contains filtered or unexported methods }
Linker is the interface for link.
Deprecated: Moved to Storager.
type Mover
deprecated
type Mover interface { // Move will move an object in the service. // // ## Behavior // // - Move only move one and only one object. // - Service DON'T NEED to support move a non-empty directory. // - User NEED to implement move a non-empty directory by themself. // - Move a file to a directory SHOULD return `ErrObjectModeInvalid`. // - Move SHOULD NOT return an error as dst object exists. // - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or // not. // - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object // if exists. // - A successful move operation SHOULD be complete, which means the dst object's content and metadata // should be the same as src object. // // Deprecated: Moved to Storager. Move(src string, dst string, pairs ...Pair) (err error) // MoveWithContext will move an object in the service. // // ## Behavior // // - Move only move one and only one object. // - Service DON'T NEED to support move a non-empty directory. // - User NEED to implement move a non-empty directory by themself. // - Move a file to a directory SHOULD return `ErrObjectModeInvalid`. // - Move SHOULD NOT return an error as dst object exists. // - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or // not. // - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object // if exists. // - A successful move operation SHOULD be complete, which means the dst object's content and metadata // should be the same as src object. // // Deprecated: Moved to Storager. MoveWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error) // contains filtered or unexported methods }
Mover is the interface for Move.
Deprecated: Moved to Storager.
type MultipartHTTPSigner
deprecated
type MultipartHTTPSigner interface { // QuerySignHTTPCompleteMultipart will complete a multipart upload and construct an Object by // using query parameters to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPCompleteMultipart(o *Object, parts []*Part, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPCompleteMultipartWithContext will complete a multipart upload and construct // an Object by using query parameters to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPCompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPCreateMultipart will create a new multipart by using query parameters to authenticate // requests. // // Deprecated: Moved to Storager. QuerySignHTTPCreateMultipart(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPCreateMultipartWithContext will create a new multipart by using query parameters // to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPCreateMultipartWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPListMultipart will list parts belong to this multipart by using query parameters // to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPListMultipart(o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPListMultipartWithContext will list parts belong to this multipart by using query // parameters to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPListMultipartWithContext(ctx context.Context, o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWriteMultipart will write content to a multipart by using query parameters to authenticate // requests. // // Deprecated: Moved to Storager. QuerySignHTTPWriteMultipart(o *Object, size int64, index int, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWriteMultipartWithContext will write content to a multipart by using query parameters // to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPWriteMultipartWithContext(ctx context.Context, o *Object, size int64, index int, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // contains filtered or unexported methods }
MultipartHTTPSigner is the interface for Multiparter related operations which support authentication.
Deprecated: Moved to Storager.
type Multiparter
deprecated
type Multiparter interface { // CompleteMultipart will complete a multipart upload and construct an Object. // // Deprecated: Moved to Storager. CompleteMultipart(o *Object, parts []*Part, pairs ...Pair) (err error) // CompleteMultipartWithContext will complete a multipart upload and construct an Object. // // Deprecated: Moved to Storager. CompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, pairs ...Pair) (err error) // CreateMultipart will create a new multipart. // // ## Behavior // // - CreateMultipart SHOULD NOT return an error as the object exists. // // Deprecated: Moved to Storager. CreateMultipart(path string, pairs ...Pair) (o *Object, err error) // CreateMultipartWithContext will create a new multipart. // // ## Behavior // // - CreateMultipart SHOULD NOT return an error as the object exists. // // Deprecated: Moved to Storager. CreateMultipartWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // ListMultipart will list parts belong to this multipart. // // Deprecated: Moved to Storager. ListMultipart(o *Object, pairs ...Pair) (pi *PartIterator, err error) // ListMultipartWithContext will list parts belong to this multipart. // // Deprecated: Moved to Storager. ListMultipartWithContext(ctx context.Context, o *Object, pairs ...Pair) (pi *PartIterator, err error) // WriteMultipart will write content to a multipart. // // Deprecated: Moved to Storager. WriteMultipart(o *Object, r io.Reader, size int64, index int, pairs ...Pair) (n int64, part *Part, err error) // WriteMultipartWithContext will write content to a multipart. // // Deprecated: Moved to Storager. WriteMultipartWithContext(ctx context.Context, o *Object, r io.Reader, size int64, index int, pairs ...Pair) (n int64, part *Part, err error) // contains filtered or unexported methods }
Multiparter is the interface for Multipart related operations.
Deprecated: Moved to Storager.
type NextBlockFunc ¶
NextBlockFunc is the func used in iterator.
Notes - ErrDone should be return while there are no items any more. - Input Block slice should be set every time.
type NextObjectFunc ¶
type NextObjectFunc func(ctx context.Context, page *ObjectPage) error
NextObjectFunc is the func used in iterator.
Notes - ErrDone should be return while there are no items any more. - Input Object slice should be set every time.
type NextPartFunc ¶
NextPartFunc is the func used in iterator.
Notes - ErrDone should be return while there are no items any more. - Input Part slice should be set every time.
type NextStoragerFunc ¶
type NextStoragerFunc func(ctx context.Context, page *StoragerPage) error
NextStoragerFunc is the func used in iterator.
Notes - ErrDone should be return while there are no items any more. - Input Storager slice should be set every time.
type Object ¶
type Object struct { // ID is the unique key in storage. // // ID SHOULD be an absolute path compatible with the target operating system-defined file paths, // or a unique identifier specified by service. ID string Mode ObjectMode // Path is either the absolute path or the relative path towards storage's WorkDir depends on user's // input. // // Path SHOULD be Unix style. Path string // contains filtered or unexported fields }
Object is the smallest unit in go-storage.
NOTES:
- Object's fields SHOULD not be changed outside services.
- Object CANNOT be copied
- Object is concurrent safe.
- Only ID, Path, Mode are required during list operations, other fields could be fetched via lazy stat logic: https://beyondstorage.io/docs/go-storage/internal/object-lazy-stat
func (*Object) GetAppendOffset ¶
GetAppendOffset will get AppendOffset from Object.
AppendOffset is the offset of the append object.
func (*Object) GetContentDisposition ¶
GetContentDisposition will get ContentDisposition from Object.
func (*Object) GetContentLength ¶
GetContentLength will get ContentLength from Object.
func (*Object) GetContentMd5 ¶
GetContentMd5 will get ContentMd5 from Object.
func (*Object) GetContentType ¶
GetContentType will get ContentType from Object.
func (*Object) GetLastModified ¶
GetLastModified will get LastModified from Object.
func (*Object) GetLinkTarget ¶
GetLinkTarget will get LinkTarget from Object.
LinkTarget is the symlink target for link object.
func (*Object) GetMode ¶
func (o *Object) GetMode() ObjectMode
func (*Object) GetMultipartID ¶
GetMultipartID will get MultipartID from Object.
MultipartID is the part id of part object.
func (*Object) GetSystemMetadata ¶
GetSystemMetadata will get SystemMetadata from Object.
SystemMetadata stores system defined metadata.
func (*Object) GetUserMetadata ¶
GetUserMetadata will get UserMetadata from Object.
UserMetadata stores user defined metadata.
func (*Object) MustGetAppendOffset ¶
MustGetAppendOffset will get AppendOffset from Object.
AppendOffset is the offset of the append object.
func (*Object) MustGetContentDisposition ¶
MustGetContentDisposition will get ContentDisposition from Object.
func (*Object) MustGetContentLength ¶
MustGetContentLength will get ContentLength from Object.
func (*Object) MustGetContentMd5 ¶
MustGetContentMd5 will get ContentMd5 from Object.
func (*Object) MustGetContentType ¶
MustGetContentType will get ContentType from Object.
func (*Object) MustGetEtag ¶
MustGetEtag will get Etag from Object.
func (*Object) MustGetLastModified ¶
MustGetLastModified will get LastModified from Object.
func (*Object) MustGetLinkTarget ¶
MustGetLinkTarget will get LinkTarget from Object.
LinkTarget is the symlink target for link object.
func (*Object) MustGetMultipartID ¶
MustGetMultipartID will get MultipartID from Object.
MultipartID is the part id of part object.
func (*Object) MustGetSystemMetadata ¶
func (o *Object) MustGetSystemMetadata() interface{}
MustGetSystemMetadata will get SystemMetadata from Object.
SystemMetadata stores system defined metadata.
func (*Object) MustGetUserMetadata ¶
MustGetUserMetadata will get UserMetadata from Object.
UserMetadata stores user defined metadata.
func (*Object) SetAppendOffset ¶
SetAppendOffset will get AppendOffset into Object.
AppendOffset is the offset of the append object.
func (*Object) SetContentDisposition ¶
SetContentDisposition will get ContentDisposition into Object.
func (*Object) SetContentLength ¶
SetContentLength will get ContentLength into Object.
func (*Object) SetContentMd5 ¶
SetContentMd5 will get ContentMd5 into Object.
func (*Object) SetContentType ¶
SetContentType will get ContentType into Object.
func (*Object) SetLastModified ¶
SetLastModified will get LastModified into Object.
func (*Object) SetLinkTarget ¶
SetLinkTarget will get LinkTarget into Object.
LinkTarget is the symlink target for link object.
func (*Object) SetMode ¶
func (o *Object) SetMode(v ObjectMode) *Object
func (*Object) SetMultipartID ¶
SetMultipartID will get MultipartID into Object.
MultipartID is the part id of part object.
func (*Object) SetSystemMetadata ¶
SetSystemMetadata will get SystemMetadata into Object.
SystemMetadata stores system defined metadata.
type ObjectIterator ¶
type ObjectIterator struct {
// contains filtered or unexported fields
}
func NewObjectIterator ¶
func NewObjectIterator(ctx context.Context, next NextObjectFunc, status Continuable) *ObjectIterator
func (*ObjectIterator) ContinuationToken ¶
func (it *ObjectIterator) ContinuationToken() string
func (*ObjectIterator) Next ¶
func (it *ObjectIterator) Next() (object *Object, err error)
type ObjectMode ¶
type ObjectMode uint32
ObjectMode describes what users can operate on this object.
Different object modes are orthogonal, and an object could have different object modes at the same time.
For example:
- ModeDir means we can do list on this object('s path) - ModeRead means we can read it as a normal file - ModeLink means we can read this object's link target
And we can compose them together:
- ModeRead | ModeLink: Think about a symlink, we can still read it. - ModeDir | ModeLink: Think about a symlink to dir. - ModeAppend | ModeRead: file in fs could be both read and append.
Reference ¶
- GSP-25: https://github.com/beyondstorage/specs/blob/master/rfcs/25-object-mode.md - Core Concept Object: https://beyondstorage.io/docs/go-storage/internal/core-concept#object
const ( // ModeDir means this Object represents a dir which can be used to list with dir mode. ModeDir ObjectMode = 1 << iota // ModeRead means this Object can be used to read content. ModeRead // ModeLink means this Object is a link which targets to another Object. ModeLink // ModePart means this Object is a Multipart Object which can be used for multipart operations. ModePart // ModeBlock means this Object is a Block Object which can be used for block operations. ModeBlock // ModePage means this Object is a Page Object which can be used for random write with offset. ModePage // ModeAppend means this Object is a Append Object which can be used for append. ModeAppend )
All available object mode
func (*ObjectMode) Add ¶
func (o *ObjectMode) Add(mode ObjectMode)
Add support add ObjectMode into current one.
Example ¶
var o ObjectMode o.Add(ModeDir) o.Add(ModeRead | ModeAppend)
Output:
func (*ObjectMode) Del ¶
func (o *ObjectMode) Del(mode ObjectMode)
Del support delete ObjectMode from current one.
Example ¶
o := ModeRead | ModeAppend o.Del(ModeAppend) o.Del(ModeRead | ModeAppend)
Output:
func (ObjectMode) IsAppend ¶
func (o ObjectMode) IsAppend() bool
func (ObjectMode) IsBlock ¶
func (o ObjectMode) IsBlock() bool
func (ObjectMode) IsDir ¶
func (o ObjectMode) IsDir() bool
func (ObjectMode) IsLink ¶
func (o ObjectMode) IsLink() bool
func (ObjectMode) IsPage ¶
func (o ObjectMode) IsPage() bool
func (ObjectMode) IsPart ¶
func (o ObjectMode) IsPart() bool
func (ObjectMode) IsRead ¶
func (o ObjectMode) IsRead() bool
func (ObjectMode) String ¶
func (o ObjectMode) String() string
String implement Stringer for ObjectMode.
An object with Read,Append will print like "read|append"
type ObjectPage ¶
type ObjectPage struct { Status Continuable Data []*Object }
type OperationError ¶
type OperationError struct {
// contains filtered or unexported fields
}
OperationError is the error for operation related errors.
func (OperationError) Error ¶
func (oe OperationError) Error() string
func (OperationError) IsInternalError ¶
func (oe OperationError) IsInternalError()
func (OperationError) Unwrap ¶
func (oe OperationError) Unwrap() error
type Pager
deprecated
type Pager interface { // CreatePage will create a new page object. // // ## Behavior // // - CreatePage SHOULD NOT return an error as the object exists. // // Deprecated: Moved to Storager. CreatePage(path string, pairs ...Pair) (o *Object, err error) // CreatePageWithContext will create a new page object. // // ## Behavior // // - CreatePage SHOULD NOT return an error as the object exists. // // Deprecated: Moved to Storager. CreatePageWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // WritePage will write content to specific offset. // // Deprecated: Moved to Storager. WritePage(o *Object, r io.Reader, size int64, offset int64, pairs ...Pair) (n int64, err error) // WritePageWithContext will write content to specific offset. // // Deprecated: Moved to Storager. WritePageWithContext(ctx context.Context, o *Object, r io.Reader, size int64, offset int64, pairs ...Pair) (n int64, err error) // contains filtered or unexported methods }
Pager is the interface for Page related operations which support random write.
Deprecated: Moved to Storager.
type Pair ¶
type Pair struct { Key string Value interface{} }
Pair will store option for storage service.
type PartIterator ¶
type PartIterator struct {
// contains filtered or unexported fields
}
func NewPartIterator ¶
func NewPartIterator(ctx context.Context, next NextPartFunc, status Continuable) *PartIterator
func (*PartIterator) ContinuationToken ¶
func (it *PartIterator) ContinuationToken() string
func (*PartIterator) Next ¶
func (it *PartIterator) Next() (object *Part, err error)
type PartPage ¶
type PartPage struct { Status Continuable Data []*Part }
type ServiceFeatures ¶
ServiceFeatures indicates features supported by servicer.
func (ServiceFeatures) Has ¶
func (s ServiceFeatures) Has(name string) bool
type Servicer ¶
type Servicer interface { String() string Features() ServiceFeatures // Create will create a new storager instance. Create(name string, pairs ...Pair) (store Storager, err error) // CreateWithContext will create a new storager instance. CreateWithContext(ctx context.Context, name string, pairs ...Pair) (store Storager, err error) // Delete will delete a storager instance. Delete(name string, pairs ...Pair) (err error) // DeleteWithContext will delete a storager instance. DeleteWithContext(ctx context.Context, name string, pairs ...Pair) (err error) // Get will get a valid storager instance for service. Get(name string, pairs ...Pair) (store Storager, err error) // GetWithContext will get a valid storager instance for service. GetWithContext(ctx context.Context, name string, pairs ...Pair) (store Storager, err error) // List will list all storager instances under this service. List(pairs ...Pair) (sti *StoragerIterator, err error) // ListWithContext will list all storager instances under this service. ListWithContext(ctx context.Context, pairs ...Pair) (sti *StoragerIterator, err error) // contains filtered or unexported methods }
type StorageFeatures ¶
type StorageFeatures struct { LoosePair bool VirtualDir bool VirtualLink bool VirtualObjectMetadata bool WriteEmptyObject bool Create bool Delete bool Metadata bool List bool Read bool Stat bool Write bool CreateAppend bool WriteAppend bool CommitAppend bool CreateBlock bool WriteBlock bool CombineBlock bool ListBlock bool Copy bool CreateDir bool Fetch bool CreateLink bool Move bool CreateMultipart bool WriteMultipart bool CompleteMultipart bool ListMultipart bool CreatePage bool WritePage bool QuerySignHTTPRead bool QuerySignHTTPWrite bool QuerySignHTTPDelete bool QuerySignHTTPCreateMultipart bool QuerySignHTTPWriteMultipart bool QuerySignHTTPListMultipart bool QuerySignHTTPCompleteMultipart bool }
StorageFeatures indicates features supported by servicer.
func (StorageFeatures) Has ¶
func (s StorageFeatures) Has(name string) bool
type StorageHTTPSigner
deprecated
type StorageHTTPSigner interface { // QuerySignHTTPDelete will delete an object from service by using query parameters to authenticate // requests. // // Deprecated: Moved to Storager. QuerySignHTTPDelete(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPDeleteWithContext will delete an object from service by using query parameters // to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPDeleteWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPRead will read data from the file by using query parameters to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPRead(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPReadWithContext will read data from the file by using query parameters to authenticate // requests. // // Deprecated: Moved to Storager. QuerySignHTTPReadWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWrite will write data into a file by using query parameters to authenticate requests. // // Deprecated: Moved to Storager. QuerySignHTTPWrite(path string, size int64, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWriteWithContext will write data into a file by using query parameters to authenticate // requests. // // Deprecated: Moved to Storager. QuerySignHTTPWriteWithContext(ctx context.Context, path string, size int64, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // contains filtered or unexported methods }
StorageHTTPSigner is the interface for Storager related operations which support authentication.
Deprecated: Moved to Storager.
type StorageMeta ¶
type StorageMeta struct { Name string Service string WorkDir string // contains filtered or unexported fields }
func NewStorageMeta ¶
func NewStorageMeta() *StorageMeta
NewStorageMeta will create a new StorageMeta.
func (*StorageMeta) GetAppendNumberMaximum ¶
func (m *StorageMeta) GetAppendNumberMaximum() (int, bool)
func (*StorageMeta) GetAppendSizeMaximum ¶
func (m *StorageMeta) GetAppendSizeMaximum() (int64, bool)
func (*StorageMeta) GetAppendTotalSizeMaximum ¶
func (m *StorageMeta) GetAppendTotalSizeMaximum() (int64, bool)
func (*StorageMeta) GetCopySizeMaximum ¶
func (m *StorageMeta) GetCopySizeMaximum() (int64, bool)
func (*StorageMeta) GetFetchSizeMaximum ¶
func (m *StorageMeta) GetFetchSizeMaximum() (int64, bool)
func (*StorageMeta) GetLocation ¶
func (m *StorageMeta) GetLocation() (string, bool)
func (*StorageMeta) GetMoveSizeMaximum ¶
func (m *StorageMeta) GetMoveSizeMaximum() (int64, bool)
func (*StorageMeta) GetMultipartNumberMaximum ¶
func (m *StorageMeta) GetMultipartNumberMaximum() (int, bool)
func (*StorageMeta) GetMultipartSizeMaximum ¶
func (m *StorageMeta) GetMultipartSizeMaximum() (int64, bool)
func (*StorageMeta) GetMultipartSizeMinimum ¶
func (m *StorageMeta) GetMultipartSizeMinimum() (int64, bool)
func (*StorageMeta) GetName ¶
func (m *StorageMeta) GetName() string
func (*StorageMeta) GetService ¶
func (m *StorageMeta) GetService() string
func (*StorageMeta) GetSystemMetadata ¶
func (m *StorageMeta) GetSystemMetadata() (interface{}, bool)
func (*StorageMeta) GetWorkDir ¶
func (m *StorageMeta) GetWorkDir() string
func (*StorageMeta) GetWriteSizeMaximum ¶
func (m *StorageMeta) GetWriteSizeMaximum() (int64, bool)
func (*StorageMeta) MustGetAppendNumberMaximum ¶
func (m *StorageMeta) MustGetAppendNumberMaximum() int
func (*StorageMeta) MustGetAppendSizeMaximum ¶
func (m *StorageMeta) MustGetAppendSizeMaximum() int64
func (*StorageMeta) MustGetAppendTotalSizeMaximum ¶
func (m *StorageMeta) MustGetAppendTotalSizeMaximum() int64
func (*StorageMeta) MustGetCopySizeMaximum ¶
func (m *StorageMeta) MustGetCopySizeMaximum() int64
func (*StorageMeta) MustGetFetchSizeMaximum ¶
func (m *StorageMeta) MustGetFetchSizeMaximum() int64
func (*StorageMeta) MustGetLocation ¶
func (m *StorageMeta) MustGetLocation() string
func (*StorageMeta) MustGetMoveSizeMaximum ¶
func (m *StorageMeta) MustGetMoveSizeMaximum() int64
func (*StorageMeta) MustGetMultipartNumberMaximum ¶
func (m *StorageMeta) MustGetMultipartNumberMaximum() int
func (*StorageMeta) MustGetMultipartSizeMaximum ¶
func (m *StorageMeta) MustGetMultipartSizeMaximum() int64
func (*StorageMeta) MustGetMultipartSizeMinimum ¶
func (m *StorageMeta) MustGetMultipartSizeMinimum() int64
func (*StorageMeta) MustGetSystemMetadata ¶
func (m *StorageMeta) MustGetSystemMetadata() interface{}
func (*StorageMeta) MustGetWriteSizeMaximum ¶
func (m *StorageMeta) MustGetWriteSizeMaximum() int64
func (*StorageMeta) SetAppendNumberMaximum ¶
func (m *StorageMeta) SetAppendNumberMaximum(v int) *StorageMeta
func (*StorageMeta) SetAppendSizeMaximum ¶
func (m *StorageMeta) SetAppendSizeMaximum(v int64) *StorageMeta
func (*StorageMeta) SetAppendTotalSizeMaximum ¶
func (m *StorageMeta) SetAppendTotalSizeMaximum(v int64) *StorageMeta
func (*StorageMeta) SetCopySizeMaximum ¶
func (m *StorageMeta) SetCopySizeMaximum(v int64) *StorageMeta
func (*StorageMeta) SetFetchSizeMaximum ¶
func (m *StorageMeta) SetFetchSizeMaximum(v int64) *StorageMeta
func (*StorageMeta) SetLocation ¶
func (m *StorageMeta) SetLocation(v string) *StorageMeta
func (*StorageMeta) SetMoveSizeMaximum ¶
func (m *StorageMeta) SetMoveSizeMaximum(v int64) *StorageMeta
func (*StorageMeta) SetMultipartNumberMaximum ¶
func (m *StorageMeta) SetMultipartNumberMaximum(v int) *StorageMeta
func (*StorageMeta) SetMultipartSizeMaximum ¶
func (m *StorageMeta) SetMultipartSizeMaximum(v int64) *StorageMeta
func (*StorageMeta) SetMultipartSizeMinimum ¶
func (m *StorageMeta) SetMultipartSizeMinimum(v int64) *StorageMeta
func (*StorageMeta) SetName ¶
func (m *StorageMeta) SetName(v string) *StorageMeta
func (*StorageMeta) SetService ¶
func (m *StorageMeta) SetService(v string) *StorageMeta
func (*StorageMeta) SetSystemMetadata ¶
func (m *StorageMeta) SetSystemMetadata(v interface{}) *StorageMeta
func (*StorageMeta) SetWorkDir ¶
func (m *StorageMeta) SetWorkDir(v string) *StorageMeta
func (*StorageMeta) SetWriteSizeMaximum ¶
func (m *StorageMeta) SetWriteSizeMaximum(v int64) *StorageMeta
type Storager ¶
type Storager interface { String() string Features() StorageFeatures // CombineBlock will combine blocks into an object. CombineBlock(o *Object, bids []string, pairs ...Pair) (err error) // CombineBlockWithContext will combine blocks into an object. CombineBlockWithContext(ctx context.Context, o *Object, bids []string, pairs ...Pair) (err error) // CommitAppend will commit and finish an append process. CommitAppend(o *Object, pairs ...Pair) (err error) // CommitAppendWithContext will commit and finish an append process. CommitAppendWithContext(ctx context.Context, o *Object, pairs ...Pair) (err error) // CompleteMultipart will complete a multipart upload and construct an Object. CompleteMultipart(o *Object, parts []*Part, pairs ...Pair) (err error) // CompleteMultipartWithContext will complete a multipart upload and construct an Object. CompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, pairs ...Pair) (err error) // Copy will copy an Object or multiple object in the service. // // ## Behavior // // - Copy only copy one and only one object. // - Service DON'T NEED to support copy a non-empty directory or copy files recursively. // - User NEED to implement copy a non-empty directory and copy recursively by themself. // - Copy a file to a directory SHOULD return ErrObjectModeInvalid. // // - Copy SHOULD NOT return an error as dst object exists. // - Service that has native support for overwrite doesn't NEED to check the dst object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the dst object // // if exists. // - A successful copy opration should be complete, which means the dst object's content and metadata // should be the same as src object. Copy(src string, dst string, pairs ...Pair) (err error) // CopyWithContext will copy an Object or multiple object in the service. // // ## Behavior // // - Copy only copy one and only one object. // - Service DON'T NEED to support copy a non-empty directory or copy files recursively. // - User NEED to implement copy a non-empty directory and copy recursively by themself. // - Copy a file to a directory SHOULD return ErrObjectModeInvalid. // // - Copy SHOULD NOT return an error as dst object exists. // - Service that has native support for overwrite doesn't NEED to check the dst object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the dst object // // if exists. // - A successful copy opration should be complete, which means the dst object's content and metadata // should be the same as src object. CopyWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error) // Create will create a new object without any api call. // // ## Behavior // // - Create SHOULD NOT send any API call. // - Create SHOULD accept ObjectMode pair as object mode. Create(path string, pairs ...Pair) (o *Object) // CreateAppend will create an append object. // // ## Behavior // // - CreateAppend SHOULD create an appendable object with position 0 and size 0. // - CreateAppend SHOULD NOT return an error as the object exist. // - Service SHOULD check and delete the object if exists. CreateAppend(path string, pairs ...Pair) (o *Object, err error) // CreateAppendWithContext will create an append object. // // ## Behavior // // - CreateAppend SHOULD create an appendable object with position 0 and size 0. // - CreateAppend SHOULD NOT return an error as the object exist. // - Service SHOULD check and delete the object if exists. CreateAppendWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // CreateBlock will create a new block object. // // ## Behavior // - CreateBlock SHOULD NOT return an error as the object exist. // - Service that has native support for overwrite doesn't NEED to check the object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the object if exists. CreateBlock(path string, pairs ...Pair) (o *Object, err error) // CreateBlockWithContext will create a new block object. // // ## Behavior // - CreateBlock SHOULD NOT return an error as the object exist. // - Service that has native support for overwrite doesn't NEED to check the object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the object if exists. CreateBlockWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // CreateDir will create a new dir object CreateDir(path string, pairs ...Pair) (o *Object, err error) // CreateDirWithContext will create a new dir object CreateDirWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // CreateLink Will create a link object. // // # Behavior // // - path and target COULD be relative or absolute path. // - If target not exists, CreateLink will still create a link object to path. // - If path exists: // - If path is a symlink object, CreateLink will remove the symlink object and create a new link object // // to path. // - If path is not a symlink object, CreateLink will return an ErrObjectModeInvalid error when the // // service does not support overwrite. // - A link object COULD be returned in Stat or List. // - CreateLink COULD implement virtual_link feature when service without native support. // - Users SHOULD enable this feature by themselves. CreateLink(path string, target string, pairs ...Pair) (o *Object, err error) // CreateLinkWithContext Will create a link object. // // # Behavior // // - path and target COULD be relative or absolute path. // - If target not exists, CreateLink will still create a link object to path. // - If path exists: // - If path is a symlink object, CreateLink will remove the symlink object and create a new link object // // to path. // - If path is not a symlink object, CreateLink will return an ErrObjectModeInvalid error when the // // service does not support overwrite. // - A link object COULD be returned in Stat or List. // - CreateLink COULD implement virtual_link feature when service without native support. // - Users SHOULD enable this feature by themselves. CreateLinkWithContext(ctx context.Context, path string, target string, pairs ...Pair) (o *Object, err error) // CreateMultipart will create a new multipart. // // ## Behavior // // - CreateMultipart SHOULD NOT return an error as the object exists. CreateMultipart(path string, pairs ...Pair) (o *Object, err error) // CreateMultipartWithContext will create a new multipart. // // ## Behavior // // - CreateMultipart SHOULD NOT return an error as the object exists. CreateMultipartWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // CreatePage will create a new page object. // // ## Behavior // // - CreatePage SHOULD NOT return an error as the object exists. CreatePage(path string, pairs ...Pair) (o *Object, err error) // CreatePageWithContext will create a new page object. // // ## Behavior // // - CreatePage SHOULD NOT return an error as the object exists. CreatePageWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // Delete will delete an object from service. // // ## Behavior // // - Delete only delete one and only one object. // - Service DON'T NEED to support remove all. // - User NEED to implement remove_all by themself. // // - Delete is idempotent. // - Successful delete always return nil error. // - Delete SHOULD never return ObjectNotExist // - Delete DON'T NEED to check the object exist or not. Delete(path string, pairs ...Pair) (err error) // DeleteWithContext will delete an object from service. // // ## Behavior // // - Delete only delete one and only one object. // - Service DON'T NEED to support remove all. // - User NEED to implement remove_all by themself. // // - Delete is idempotent. // - Successful delete always return nil error. // - Delete SHOULD never return ObjectNotExist // - Delete DON'T NEED to check the object exist or not. DeleteWithContext(ctx context.Context, path string, pairs ...Pair) (err error) // Fetch will fetch from a given url to path. // // ## Behavior // // - Fetch SHOULD NOT return an error as the object exists. // - A successful fetch operation should be complete, which means the object's content and metadata // should be the same as requiring from the url. Fetch(path string, url string, pairs ...Pair) (err error) // FetchWithContext will fetch from a given url to path. // // ## Behavior // // - Fetch SHOULD NOT return an error as the object exists. // - A successful fetch operation should be complete, which means the object's content and metadata // should be the same as requiring from the url. FetchWithContext(ctx context.Context, path string, url string, pairs ...Pair) (err error) // List will return list a specific path. // // ## Behavior // // - Service SHOULD support default ListMode. // - Service SHOULD implement ListModeDir without the check for VirtualDir. // - Service DON'T NEED to Stat while in List. List(path string, pairs ...Pair) (oi *ObjectIterator, err error) // ListWithContext will return list a specific path. // // ## Behavior // // - Service SHOULD support default ListMode. // - Service SHOULD implement ListModeDir without the check for VirtualDir. // - Service DON'T NEED to Stat while in List. ListWithContext(ctx context.Context, path string, pairs ...Pair) (oi *ObjectIterator, err error) // ListBlock will list blocks belong to this object. ListBlock(o *Object, pairs ...Pair) (bi *BlockIterator, err error) // ListBlockWithContext will list blocks belong to this object. ListBlockWithContext(ctx context.Context, o *Object, pairs ...Pair) (bi *BlockIterator, err error) // ListMultipart will list parts belong to this multipart. ListMultipart(o *Object, pairs ...Pair) (pi *PartIterator, err error) // ListMultipartWithContext will list parts belong to this multipart. ListMultipartWithContext(ctx context.Context, o *Object, pairs ...Pair) (pi *PartIterator, err error) // Metadata will return current storager metadata. Metadata(pairs ...Pair) (meta *StorageMeta) // Move will move an object in the service. // // ## Behavior // // - Move only move one and only one object. // - Service DON'T NEED to support move a non-empty directory. // - User NEED to implement move a non-empty directory by themself. // - Move a file to a directory SHOULD return ErrObjectModeInvalid. // // - Move SHOULD NOT return an error as dst object exists. // - Service that has native support for overwrite doesn't NEED to check the dst object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the dst object // // if exists. // - A successful move operation SHOULD be complete, which means the dst object's content and metadata // should be the same as src object. Move(src string, dst string, pairs ...Pair) (err error) // MoveWithContext will move an object in the service. // // ## Behavior // // - Move only move one and only one object. // - Service DON'T NEED to support move a non-empty directory. // - User NEED to implement move a non-empty directory by themself. // - Move a file to a directory SHOULD return ErrObjectModeInvalid. // // - Move SHOULD NOT return an error as dst object exists. // - Service that has native support for overwrite doesn't NEED to check the dst object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the dst object // // if exists. // - A successful move operation SHOULD be complete, which means the dst object's content and metadata // should be the same as src object. MoveWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error) // QuerySignHTTPCompleteMultipart will complete a multipart upload and construct an Object by // using query parameters to authenticate requests. QuerySignHTTPCompleteMultipart(o *Object, parts []*Part, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPCompleteMultipartWithContext will complete a multipart upload and construct // an Object by using query parameters to authenticate requests. QuerySignHTTPCompleteMultipartWithContext(ctx context.Context, o *Object, parts []*Part, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPCreateMultipart will create a new multipart by using query parameters to authenticate // requests. QuerySignHTTPCreateMultipart(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPCreateMultipartWithContext will create a new multipart by using query parameters // to authenticate requests. QuerySignHTTPCreateMultipartWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPDelete will delete an object from service by using query parameters to authenticate // requests. QuerySignHTTPDelete(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPDeleteWithContext will delete an object from service by using query parameters // to authenticate requests. QuerySignHTTPDeleteWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPListMultipart will list parts belong to this multipart by using query parameters // to authenticate requests. QuerySignHTTPListMultipart(o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPListMultipartWithContext will list parts belong to this multipart by using query // parameters to authenticate requests. QuerySignHTTPListMultipartWithContext(ctx context.Context, o *Object, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPRead will read data from the file by using query parameters to authenticate requests. QuerySignHTTPRead(path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPReadWithContext will read data from the file by using query parameters to authenticate // requests. QuerySignHTTPReadWithContext(ctx context.Context, path string, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWrite will write data into a file by using query parameters to authenticate requests. QuerySignHTTPWrite(path string, size int64, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWriteWithContext will write data into a file by using query parameters to authenticate // requests. QuerySignHTTPWriteWithContext(ctx context.Context, path string, size int64, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWriteMultipart will write content to a multipart by using query parameters to authenticate // requests. QuerySignHTTPWriteMultipart(o *Object, size int64, index int, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // QuerySignHTTPWriteMultipartWithContext will write content to a multipart by using query parameters // to authenticate requests. QuerySignHTTPWriteMultipartWithContext(ctx context.Context, o *Object, size int64, index int, expire time.Duration, pairs ...Pair) (req *http.Request, err error) // Read will read the file's data. Read(path string, w io.Writer, pairs ...Pair) (n int64, err error) // ReadWithContext will read the file's data. ReadWithContext(ctx context.Context, path string, w io.Writer, pairs ...Pair) (n int64, err error) // Stat will stat a path to get info of an object. // // ## Behavior // // - Stat SHOULD accept ObjectMode pair as hints. // - Service COULD have different implementations for different object mode. // - Service SHOULD check if returning ObjectMode is match Stat(path string, pairs ...Pair) (o *Object, err error) // StatWithContext will stat a path to get info of an object. // // ## Behavior // // - Stat SHOULD accept ObjectMode pair as hints. // - Service COULD have different implementations for different object mode. // - Service SHOULD check if returning ObjectMode is match StatWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) // Write will write data into a file. // // ## Behavior // // - Write SHOULD support users pass nil io.Reader. // - Service that has native support for pass nil io.Reader doesn't NEED to check the io.Reader is nil // // or not. // - Service that doesn't have native support for pass nil io.Reader SHOULD check and create an empty // // io.Reader if it is nil. // - Write SHOULD NOT return an error as the object exist. // - Service that has native support for overwrite doesn't NEED to check the object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the object if exists. // // - A successful write operation SHOULD be complete, which means the object's content and metadata // should be the same as specified in write request. Write(path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error) // WriteWithContext will write data into a file. // // ## Behavior // // - Write SHOULD support users pass nil io.Reader. // - Service that has native support for pass nil io.Reader doesn't NEED to check the io.Reader is nil // // or not. // - Service that doesn't have native support for pass nil io.Reader SHOULD check and create an empty // // io.Reader if it is nil. // - Write SHOULD NOT return an error as the object exist. // - Service that has native support for overwrite doesn't NEED to check the object exists or not. // - Service that doesn't have native support for overwrite SHOULD check and delete the object if exists. // // - A successful write operation SHOULD be complete, which means the object's content and metadata // should be the same as specified in write request. WriteWithContext(ctx context.Context, path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error) // WriteAppend will append content to an append object. WriteAppend(o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error) // WriteAppendWithContext will append content to an append object. WriteAppendWithContext(ctx context.Context, o *Object, r io.Reader, size int64, pairs ...Pair) (n int64, err error) // WriteBlock will write content to a block. WriteBlock(o *Object, r io.Reader, size int64, bid string, pairs ...Pair) (n int64, err error) // WriteBlockWithContext will write content to a block. WriteBlockWithContext(ctx context.Context, o *Object, r io.Reader, size int64, bid string, pairs ...Pair) (n int64, err error) // WriteMultipart will write content to a multipart. WriteMultipart(o *Object, r io.Reader, size int64, index int, pairs ...Pair) (n int64, part *Part, err error) // WriteMultipartWithContext will write content to a multipart. WriteMultipartWithContext(ctx context.Context, o *Object, r io.Reader, size int64, index int, pairs ...Pair) (n int64, part *Part, err error) // WritePage will write content to specific offset. WritePage(o *Object, r io.Reader, size int64, offset int64, pairs ...Pair) (n int64, err error) // WritePageWithContext will write content to specific offset. WritePageWithContext(ctx context.Context, o *Object, r io.Reader, size int64, offset int64, pairs ...Pair) (n int64, err error) // contains filtered or unexported methods }
type StoragerIterator ¶
type StoragerIterator struct {
// contains filtered or unexported fields
}
func NewStoragerIterator ¶
func NewStoragerIterator(ctx context.Context, next NextStoragerFunc, status Continuable) *StoragerIterator
func (*StoragerIterator) ContinuationToken ¶
func (it *StoragerIterator) ContinuationToken() string
func (*StoragerIterator) Next ¶
func (it *StoragerIterator) Next() (object Storager, err error)
type StoragerPage ¶
type StoragerPage struct { Status Continuable Data []Storager }
type UnimplementedAppender
deprecated
type UnimplementedAppender struct { }
UnimplementedAppender must be embedded to have forward compatible implementations.
Appender is the interface for Append related operations.
Deprecated: Moved to Storager.
func (UnimplementedAppender) CommitAppend ¶
func (s UnimplementedAppender) CommitAppend(o *Object, pairs ...Pair) (err error)
func (UnimplementedAppender) CommitAppendWithContext ¶
func (UnimplementedAppender) CreateAppend ¶
func (s UnimplementedAppender) CreateAppend(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedAppender) CreateAppendWithContext ¶
func (UnimplementedAppender) String ¶
func (s UnimplementedAppender) String() string
func (UnimplementedAppender) WriteAppend ¶
type UnimplementedBlocker
deprecated
type UnimplementedBlocker struct { }
UnimplementedBlocker must be embedded to have forward compatible implementations.
Blocker is the interface for Block related operations.
Deprecated: Moved to Storager.
func (UnimplementedBlocker) CombineBlock ¶
func (s UnimplementedBlocker) CombineBlock(o *Object, bids []string, pairs ...Pair) (err error)
func (UnimplementedBlocker) CombineBlockWithContext ¶
func (UnimplementedBlocker) CreateBlock ¶
func (s UnimplementedBlocker) CreateBlock(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedBlocker) CreateBlockWithContext ¶
func (UnimplementedBlocker) ListBlock ¶
func (s UnimplementedBlocker) ListBlock(o *Object, pairs ...Pair) (bi *BlockIterator, err error)
func (UnimplementedBlocker) ListBlockWithContext ¶
func (s UnimplementedBlocker) ListBlockWithContext(ctx context.Context, o *Object, pairs ...Pair) (bi *BlockIterator, err error)
func (UnimplementedBlocker) String ¶
func (s UnimplementedBlocker) String() string
func (UnimplementedBlocker) WriteBlock ¶
type UnimplementedCopier
deprecated
type UnimplementedCopier struct { }
UnimplementedCopier must be embedded to have forward compatible implementations.
Copier is the interface for Copy.
Deprecated: Moved to Storager.
func (UnimplementedCopier) Copy ¶
func (s UnimplementedCopier) Copy(src string, dst string, pairs ...Pair) (err error)
func (UnimplementedCopier) CopyWithContext ¶
func (UnimplementedCopier) String ¶
func (s UnimplementedCopier) String() string
type UnimplementedDirer
deprecated
type UnimplementedDirer struct { }
UnimplementedDirer must be embedded to have forward compatible implementations.
Direr is the interface for Directory.
Deprecated: Moved to Storager.
func (UnimplementedDirer) CreateDir ¶
func (s UnimplementedDirer) CreateDir(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedDirer) CreateDirWithContext ¶
func (UnimplementedDirer) String ¶
func (s UnimplementedDirer) String() string
type UnimplementedFetcher
deprecated
type UnimplementedFetcher struct { }
UnimplementedFetcher must be embedded to have forward compatible implementations.
Fetcher is the interface for Fetch.
Deprecated: Moved to Storager.
func (UnimplementedFetcher) Fetch ¶
func (s UnimplementedFetcher) Fetch(path string, url string, pairs ...Pair) (err error)
func (UnimplementedFetcher) FetchWithContext ¶
func (UnimplementedFetcher) String ¶
func (s UnimplementedFetcher) String() string
type UnimplementedLinker
deprecated
type UnimplementedLinker struct { }
UnimplementedLinker must be embedded to have forward compatible implementations.
Linker is the interface for link.
Deprecated: Moved to Storager.
func (UnimplementedLinker) CreateLink ¶
func (UnimplementedLinker) CreateLinkWithContext ¶
func (UnimplementedLinker) String ¶
func (s UnimplementedLinker) String() string
type UnimplementedMover
deprecated
type UnimplementedMover struct { }
UnimplementedMover must be embedded to have forward compatible implementations.
Mover is the interface for Move.
Deprecated: Moved to Storager.
func (UnimplementedMover) Move ¶
func (s UnimplementedMover) Move(src string, dst string, pairs ...Pair) (err error)
func (UnimplementedMover) MoveWithContext ¶
func (UnimplementedMover) String ¶
func (s UnimplementedMover) String() string
type UnimplementedMultipartHTTPSigner
deprecated
type UnimplementedMultipartHTTPSigner struct { }
UnimplementedMultipartHTTPSigner must be embedded to have forward compatible implementations.
MultipartHTTPSigner is the interface for Multiparter related operations which support authentication.
Deprecated: Moved to Storager.
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPCompleteMultipart ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPCompleteMultipartWithContext ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPCreateMultipart ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPCreateMultipartWithContext ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPListMultipart ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPListMultipartWithContext ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPWriteMultipart ¶
func (UnimplementedMultipartHTTPSigner) QuerySignHTTPWriteMultipartWithContext ¶
func (UnimplementedMultipartHTTPSigner) String ¶
func (s UnimplementedMultipartHTTPSigner) String() string
type UnimplementedMultiparter
deprecated
type UnimplementedMultiparter struct { }
UnimplementedMultiparter must be embedded to have forward compatible implementations.
Multiparter is the interface for Multipart related operations.
Deprecated: Moved to Storager.
func (UnimplementedMultiparter) CompleteMultipart ¶
func (s UnimplementedMultiparter) CompleteMultipart(o *Object, parts []*Part, pairs ...Pair) (err error)
func (UnimplementedMultiparter) CompleteMultipartWithContext ¶
func (UnimplementedMultiparter) CreateMultipart ¶
func (s UnimplementedMultiparter) CreateMultipart(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedMultiparter) CreateMultipartWithContext ¶
func (UnimplementedMultiparter) ListMultipart ¶
func (s UnimplementedMultiparter) ListMultipart(o *Object, pairs ...Pair) (pi *PartIterator, err error)
func (UnimplementedMultiparter) ListMultipartWithContext ¶
func (s UnimplementedMultiparter) ListMultipartWithContext(ctx context.Context, o *Object, pairs ...Pair) (pi *PartIterator, err error)
func (UnimplementedMultiparter) String ¶
func (s UnimplementedMultiparter) String() string
func (UnimplementedMultiparter) WriteMultipart ¶
type UnimplementedPager
deprecated
type UnimplementedPager struct { }
UnimplementedPager must be embedded to have forward compatible implementations.
Pager is the interface for Page related operations which support random write.
Deprecated: Moved to Storager.
func (UnimplementedPager) CreatePage ¶
func (s UnimplementedPager) CreatePage(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedPager) CreatePageWithContext ¶
func (UnimplementedPager) String ¶
func (s UnimplementedPager) String() string
type UnimplementedServicer ¶
type UnimplementedServicer struct { }
UnimplementedServicer must be embedded to have forward compatible implementations.
func (UnimplementedServicer) Create ¶
func (s UnimplementedServicer) Create(name string, pairs ...Pair) (store Storager, err error)
func (UnimplementedServicer) CreateWithContext ¶
func (UnimplementedServicer) Delete ¶
func (s UnimplementedServicer) Delete(name string, pairs ...Pair) (err error)
func (UnimplementedServicer) DeleteWithContext ¶
func (UnimplementedServicer) Features ¶
func (s UnimplementedServicer) Features() (fe ServiceFeatures)
func (UnimplementedServicer) Get ¶
func (s UnimplementedServicer) Get(name string, pairs ...Pair) (store Storager, err error)
func (UnimplementedServicer) GetWithContext ¶
func (UnimplementedServicer) List ¶
func (s UnimplementedServicer) List(pairs ...Pair) (sti *StoragerIterator, err error)
func (UnimplementedServicer) ListWithContext ¶
func (s UnimplementedServicer) ListWithContext(ctx context.Context, pairs ...Pair) (sti *StoragerIterator, err error)
func (UnimplementedServicer) String ¶
func (s UnimplementedServicer) String() string
type UnimplementedStorageHTTPSigner
deprecated
type UnimplementedStorageHTTPSigner struct { }
UnimplementedStorageHTTPSigner must be embedded to have forward compatible implementations.
StorageHTTPSigner is the interface for Storager related operations which support authentication.
Deprecated: Moved to Storager.
func (UnimplementedStorageHTTPSigner) QuerySignHTTPDelete ¶
func (UnimplementedStorageHTTPSigner) QuerySignHTTPDeleteWithContext ¶
func (UnimplementedStorageHTTPSigner) QuerySignHTTPRead ¶
func (UnimplementedStorageHTTPSigner) QuerySignHTTPReadWithContext ¶
func (UnimplementedStorageHTTPSigner) QuerySignHTTPWrite ¶
func (UnimplementedStorageHTTPSigner) QuerySignHTTPWriteWithContext ¶
func (UnimplementedStorageHTTPSigner) String ¶
func (s UnimplementedStorageHTTPSigner) String() string
type UnimplementedStorager ¶
type UnimplementedStorager struct { }
UnimplementedStorager must be embedded to have forward compatible implementations.
func (UnimplementedStorager) CombineBlock ¶
func (s UnimplementedStorager) CombineBlock(o *Object, bids []string, pairs ...Pair) (err error)
func (UnimplementedStorager) CombineBlockWithContext ¶
func (UnimplementedStorager) CommitAppend ¶
func (s UnimplementedStorager) CommitAppend(o *Object, pairs ...Pair) (err error)
func (UnimplementedStorager) CommitAppendWithContext ¶
func (UnimplementedStorager) CompleteMultipart ¶
func (s UnimplementedStorager) CompleteMultipart(o *Object, parts []*Part, pairs ...Pair) (err error)
func (UnimplementedStorager) CompleteMultipartWithContext ¶
func (UnimplementedStorager) Copy ¶
func (s UnimplementedStorager) Copy(src string, dst string, pairs ...Pair) (err error)
func (UnimplementedStorager) CopyWithContext ¶
func (UnimplementedStorager) Create ¶
func (s UnimplementedStorager) Create(path string, pairs ...Pair) (o *Object)
func (UnimplementedStorager) CreateAppend ¶
func (s UnimplementedStorager) CreateAppend(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedStorager) CreateAppendWithContext ¶
func (UnimplementedStorager) CreateBlock ¶
func (s UnimplementedStorager) CreateBlock(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedStorager) CreateBlockWithContext ¶
func (UnimplementedStorager) CreateDir ¶
func (s UnimplementedStorager) CreateDir(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedStorager) CreateDirWithContext ¶
func (UnimplementedStorager) CreateLink ¶
func (UnimplementedStorager) CreateLinkWithContext ¶
func (UnimplementedStorager) CreateMultipart ¶
func (s UnimplementedStorager) CreateMultipart(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedStorager) CreateMultipartWithContext ¶
func (UnimplementedStorager) CreatePage ¶
func (s UnimplementedStorager) CreatePage(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedStorager) CreatePageWithContext ¶
func (UnimplementedStorager) Delete ¶
func (s UnimplementedStorager) Delete(path string, pairs ...Pair) (err error)
func (UnimplementedStorager) DeleteWithContext ¶
func (UnimplementedStorager) Features ¶
func (s UnimplementedStorager) Features() (fe StorageFeatures)
func (UnimplementedStorager) Fetch ¶
func (s UnimplementedStorager) Fetch(path string, url string, pairs ...Pair) (err error)
func (UnimplementedStorager) FetchWithContext ¶
func (UnimplementedStorager) List ¶
func (s UnimplementedStorager) List(path string, pairs ...Pair) (oi *ObjectIterator, err error)
func (UnimplementedStorager) ListBlock ¶
func (s UnimplementedStorager) ListBlock(o *Object, pairs ...Pair) (bi *BlockIterator, err error)
func (UnimplementedStorager) ListBlockWithContext ¶
func (s UnimplementedStorager) ListBlockWithContext(ctx context.Context, o *Object, pairs ...Pair) (bi *BlockIterator, err error)
func (UnimplementedStorager) ListMultipart ¶
func (s UnimplementedStorager) ListMultipart(o *Object, pairs ...Pair) (pi *PartIterator, err error)
func (UnimplementedStorager) ListMultipartWithContext ¶
func (s UnimplementedStorager) ListMultipartWithContext(ctx context.Context, o *Object, pairs ...Pair) (pi *PartIterator, err error)
func (UnimplementedStorager) ListWithContext ¶
func (s UnimplementedStorager) ListWithContext(ctx context.Context, path string, pairs ...Pair) (oi *ObjectIterator, err error)
func (UnimplementedStorager) Metadata ¶
func (s UnimplementedStorager) Metadata(pairs ...Pair) (meta *StorageMeta)
func (UnimplementedStorager) Move ¶
func (s UnimplementedStorager) Move(src string, dst string, pairs ...Pair) (err error)
func (UnimplementedStorager) MoveWithContext ¶
func (UnimplementedStorager) QuerySignHTTPCompleteMultipart ¶
func (UnimplementedStorager) QuerySignHTTPCompleteMultipartWithContext ¶
func (UnimplementedStorager) QuerySignHTTPCreateMultipart ¶
func (UnimplementedStorager) QuerySignHTTPCreateMultipartWithContext ¶
func (UnimplementedStorager) QuerySignHTTPDelete ¶
func (UnimplementedStorager) QuerySignHTTPDeleteWithContext ¶
func (UnimplementedStorager) QuerySignHTTPListMultipart ¶
func (UnimplementedStorager) QuerySignHTTPListMultipartWithContext ¶
func (UnimplementedStorager) QuerySignHTTPRead ¶
func (UnimplementedStorager) QuerySignHTTPReadWithContext ¶
func (UnimplementedStorager) QuerySignHTTPWrite ¶
func (UnimplementedStorager) QuerySignHTTPWriteMultipart ¶
func (UnimplementedStorager) QuerySignHTTPWriteMultipartWithContext ¶
func (UnimplementedStorager) QuerySignHTTPWriteWithContext ¶
func (UnimplementedStorager) ReadWithContext ¶
func (UnimplementedStorager) Stat ¶
func (s UnimplementedStorager) Stat(path string, pairs ...Pair) (o *Object, err error)
func (UnimplementedStorager) StatWithContext ¶
func (UnimplementedStorager) String ¶
func (s UnimplementedStorager) String() string