Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PathSeparator is a path components separator string. PathSeparator = string(os.PathSeparator) )
Variables ¶
View Source
var ( // ErrObjectExists is returned on attempts to create already existing object. ErrObjectExists = errors.New("object exists") // ErrObjectNotExists is returned on attempts to work with non-existing object. ErrObjectNotExists = errors.New("object not exists") )
Functions ¶
func NameFromString ¶
NameFromString splits name into base file name and directory path.
Types ¶
type BucketInfo ¶
BucketInfo stores basic bucket data.
type Client ¶
type Client interface { NeoFS ListBuckets(ctx context.Context) ([]*BucketInfo, error) GetBucketInfo(ctx context.Context, name string) (*BucketInfo, error) GetObject(ctx context.Context, p *GetObjectParams) error GetObjectInfo(ctx context.Context, bucketName, objectName string) (*ObjectInfo, error) PutObject(ctx context.Context, p *PutObjectParams) (*ObjectInfo, error) CopyObject(ctx context.Context, p *CopyObjectParams) (*ObjectInfo, error) ListObjects(ctx context.Context, p *ListObjectsParams) (*ListObjectsInfo, error) DeleteObject(ctx context.Context, bucket, object string) error DeleteObjects(ctx context.Context, bucket string, objects []string) []error }
Client provides S3 API client interface.
type CopyObjectParams ¶
type CopyObjectParams struct { SrcBucket string DstBucket string SrcObject string DstObject string Header map[string]string }
CopyObjectParams stores object copy request parameters.
type GetObjectParams ¶
type GetObjectParams struct { Bucket string Object string Offset int64 Length int64 Writer io.Writer }
GetObjectParams stores object get request parameters.
type ListObjectsInfo ¶
type ListObjectsInfo struct { // Indicates whether the returned list objects response is truncated. A // value of true indicates that the list was truncated. The list can be truncated // if the number of objects exceeds the limit allowed or specified // by max keys. IsTruncated bool // When response is truncated (the IsTruncated element value in the response // is true), you can use the key name in this field as marker in the subsequent // request to get next set of objects. // // NOTE: This element is returned only if you have delimiter request parameter // specified. ContinuationToken string NextContinuationToken string // List of objects info for this request. Objects []*ObjectInfo // List of prefixes for this request. Prefixes []string }
ListObjectsInfo - container for list objects.
type ListObjectsParams ¶
type ListObjectsParams struct { Bucket string Prefix string Token string Delimiter string MaxKeys int }
ListObjectsParams represents object listing request parameters.
type ObjectInfo ¶
type ObjectInfo struct { Bucket string Name string Size int64 ContentType string Created time.Time Owner *owner.ID Headers map[string]string // contains filtered or unexported fields }
ObjectInfo holds S3 object data.
func (*ObjectInfo) IsDir ¶
func (o *ObjectInfo) IsDir() bool
IsDir allows to check if object is a directory.
Click to show internal directories.
Click to hide internal directories.