Documentation ¶
Index ¶
- Constants
- Variables
- func NameFromString(name string) (string, string)
- type BucketInfo
- type Client
- type CopyObjectParams
- type CreateBucketParams
- type DeleteBucketParams
- type DeletedObjectInfo
- type GetObjectParams
- type ListObjectVersionsInfo
- type ListObjectVersionsParams
- type ListObjectsInfo
- type ListObjectsParams
- type NeoFS
- type ObjectInfo
- type ObjectVersionInfo
- type Params
- type PutObjectParams
- type RangeParams
Constants ¶
const PathSeparator = string(os.PathSeparator)
PathSeparator is a path components separator string.
Variables ¶
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") // ErrBucketAlreadyExists is returned on attempts to create already existing bucket. ErrBucketAlreadyExists = errors.New("bucket exists") // ErrBucketNotFound is returned on attempts to get not existing bucket. ErrBucketNotFound = errors.New("bucket not found") )
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) CreateBucket(ctx context.Context, p *CreateBucketParams) (*cid.ID, error) DeleteBucket(ctx context.Context, p *DeleteBucketParams) 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) ListObjectVersions(ctx context.Context, p *ListObjectVersionsParams) (*ListObjectVersionsInfo, 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 SrcSize int64 Header map[string]string }
CopyObjectParams stores object copy request parameters.
type CreateBucketParams ¶ added in v0.16.0
type CreateBucketParams struct { Name string ACL uint32 Policy *netmap.PlacementPolicy }
CreateBucketParams stores bucket create request parameters.
type DeleteBucketParams ¶ added in v0.16.0
type DeleteBucketParams struct {
Name string
}
DeleteBucketParams stores delete bucket request parameters.
type DeletedObjectInfo ¶ added in v0.16.0
type DeletedObjectInfo struct { Owner *owner.ID Key string VersionID string IsLatest bool LastModified string }
DeletedObjectInfo stores info about deleted versions of objects.
type GetObjectParams ¶
type GetObjectParams struct { Range *RangeParams Bucket string Object string Offset int64 Length int64 Writer io.Writer }
GetObjectParams stores object get request parameters.
type ListObjectVersionsInfo ¶ added in v0.16.0
type ListObjectVersionsInfo struct { CommonPrefixes []*string IsTruncated bool KeyMarker string NextKeyMarker string NextVersionIDMarker string Version []*ObjectVersionInfo DeleteMarker []*DeletedObjectInfo VersionIDMarker string }
ListObjectVersionsInfo stores info and list of objects' versions.
type ListObjectVersionsParams ¶ added in v0.16.0
type ListObjectVersionsParams struct { Bucket string Delimiter string KeyMarker string MaxKeys int Prefix string VersionIDMarker string Encode string }
ListObjectVersionsParams stores list objects versions 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 // 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. NextMarker 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 Marker string Version int }
ListObjectsParams represents object listing request parameters.
type ObjectInfo ¶
type ObjectInfo struct { Bucket string Name string Size int64 ContentType string Created time.Time HashSum string 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.
type ObjectVersionInfo ¶ added in v0.16.0
type ObjectVersionInfo struct { Object *ObjectInfo IsLatest bool VersionID string }
ObjectVersionInfo stores info about objects versions.
type Params ¶
type Params struct { Pool pool.Pool Logger *zap.Logger Timeout time.Duration Key *ecdsa.PrivateKey }
Params stores basic API parameters.
type PutObjectParams ¶
type PutObjectParams struct { Bucket string Object string Size int64 Reader io.Reader Header map[string]string }
PutObjectParams stores object put request parameters.
type RangeParams ¶ added in v0.16.0
RangeParams stores range header request parameters.