Documentation ¶
Index ¶
- Variables
- func CheckBucketName(v string) error
- func CheckObjectNameV1(v string) error
- func CheckObjectNameV2(v string) error
- type Client
- type CopyOptions
- type DelOptions
- type Factory
- type GetOptions
- type ListOptions
- type ObjectInput
- func InputBoolean(bucket string, key string, v bool) ObjectInput
- func InputFile(bucket string, key string, file string) ObjectInput
- func InputMarshalJson(bucket string, key string, vPointer interface{}) ObjectInput
- func InputMarshalProto(bucket string, key string, v proto.Message) ObjectInput
- func InputNumber(bucket string, key string, v interface{}) ObjectInput
- func InputReadSeeker(bucket string, key string, body io.ReadSeeker) ObjectInput
- func InputString(bucket string, key string, v string) ObjectInput
- type ObjectOutput
- type ObjectOutputHook
- type Options
- type Position
- type PresignOptions
- type PutOptions
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchKey = errors.New("NoSuchKey: The specified key does not exist.")
Functions ¶
func CheckBucketName ¶
CheckBucketName check the compliance of the bucket name.
func CheckObjectNameV1 ¶
CheckObjectNameV1 check the compliance of the object name.
func CheckObjectNameV2 ¶
CheckObjectNameV2 check the compliance of the object name with CheckObjectNameV1 and verify if the object name ends with '/'.
Types ¶
type Client ¶
type Client interface { // PutObject put object to storage PutObject(input ObjectInput, opts ...func(o *PutOptions)) error // PutFolder put files in folder to storage PutFolder(bucket string, prefix string, root string, opts ...func(o *PutOptions)) error // GetObject get object GetObject(bucket string, key string, opts ...func(o *GetOptions)) (*ObjectOutputHook, error) // GetObjectsWithIterator get object list GetObjectsWithIterator(bucket string, prefix string, iterator func(keys []*string) error, opts ...func(o *ListOptions)) error // DelObject delete object with key DelObject(bucket string, key string, opts ...func(o *DelOptions)) error // DelPrefix delete object list with prefix DelPrefix(bucket string, prefix string, opts ...func(o *DelOptions)) error // Copy copy Object to target // If the source is prefixed, copy all the objects Copy(src Position, dst Position, opts ...func(o *CopyOptions)) error // IsExist query whether the object exists // If the query is prefixed, the key needs to end with '/' IsExist(bucket string, key string, opts ...func(o *GetOptions)) (bool, error) // Presign url of object Presign(bucket string, key string, opts ...func(o *PresignOptions)) (string, error) // Compress compress object into '*.tar.gz' // If compressing multiple objects, the key needs to end with '/' Compress(bucket string, key string, dst io.Writer, opts ...func(o *ListOptions)) error }
type CopyOptions ¶
CopyOptions .
func NewCopyOptions ¶
func NewCopyOptions(opts ...func(o *CopyOptions)) *CopyOptions
NewCopyOptions .
type DelOptions ¶
type DelOptions struct { // Context . Context context.Context // VersionID version id VersionID string }
DelOptions .
type Factory ¶
type Factory struct { // Concurrency The number of goroutines Works int // contains filtered or unexported fields }
Factory .
type GetOptions ¶
type GetOptions struct { // Context . Context context.Context // VersionID object version VersionID string }
GetOptions .
type ListOptions ¶
type ListOptions struct { // Context . Context context.Context // MaxKeys . MaxKeys int // Recursive Ignore '/' delimiter Recursive bool }
ListOptions .
func NewListOptions ¶
func NewListOptions(opts ...func(o *ListOptions)) *ListOptions
NewListOptions .
type ObjectInput ¶
type ObjectInput interface { Bucket() string Key() string ContentType() string Close() error Error() error Body() io.ReadSeeker }
func InputMarshalJson ¶
func InputMarshalJson(bucket string, key string, vPointer interface{}) ObjectInput
InputMarshalJson .
func InputMarshalProto ¶
func InputMarshalProto(bucket string, key string, v proto.Message) ObjectInput
InputMarshalProto .
func InputNumber ¶
func InputNumber(bucket string, key string, v interface{}) ObjectInput
InputNumber .
func InputReadSeeker ¶
func InputReadSeeker(bucket string, key string, body io.ReadSeeker) ObjectInput
InputReadSeeker .
type ObjectOutput ¶
type ObjectOutput interface { Bucket() string Key() string ContentType() content.Type Decode(vPointer interface{}) error Body() io.ReadCloser Close() error }
func OutputReadCloser ¶
func OutputReadCloser(bucket string, key string, contenttype string, body io.ReadCloser) ObjectOutput
OutputReadCloser .
type ObjectOutputHook ¶
type Options ¶
type Options struct { // Context context Context context.Context // Timeout 连接超时时间 Timeout time.Duration // Region region Region string // SSL use ssl UseSSL bool }
Options .
type PresignOptions ¶
type PresignOptions struct { // Context . Context context.Context // VersionID data version VersionID string // Expires expires time (s) Expires time.Duration }
PresignOptions .
func NewPresignOptions ¶
func NewPresignOptions(opts ...func(o *PresignOptions)) *PresignOptions
NewPresignOptions .
type PutOptions ¶
PutOptions .
Click to show internal directories.
Click to hide internal directories.