Documentation
¶
Overview ¶
Copyright 2025 Accelerated Cloud Storage Corporation. All Rights Reserved. Package client provides a Go client for interacting with the Accelerated Cloud Storage service.
Copyright 2025 Accelerated Cloud Storage Corporation. All Rights Reserved. Package client provides a Go client for interacting with the Accelerated Cloud Storage service.
Copyright 2025 Accelerated Cloud Storage Corporation. All Rights Reserved. Package client provides a Go client for interacting with the Accelerated Cloud Storage service.
Index ¶
- type ACSClient
- func (client *ACSClient) Close() error
- func (client *ACSClient) CopyObject(ctx context.Context, bucket, copySource, key string) error
- func (client *ACSClient) CreateBucket(ctx context.Context, bucket, region string) error
- func (client *ACSClient) DeleteBucket(ctx context.Context, bucket string) error
- func (client *ACSClient) DeleteObject(ctx context.Context, bucket, key string) error
- func (client *ACSClient) DeleteObjects(bucket string, keys []string) error
- func (client *ACSClient) GetObject(ctx context.Context, bucket, key string) ([]byte, error)
- func (client *ACSClient) HeadBucket(ctx context.Context, bucket string) (*HeadBucketOutput, error)
- func (client *ACSClient) HeadObject(ctx context.Context, bucket, key string) (*HeadObjectOutput, error)
- func (client *ACSClient) ListBuckets(ctx context.Context) ([]*pb.Bucket, error)
- func (client *ACSClient) ListObjects(ctx context.Context, bucket string, opts *ListObjectsOptions) ([]string, error)
- func (client *ACSClient) PutObject(ctx context.Context, bucket, key string, data []byte) error
- func (client *ACSClient) RotateKey(ctx context.Context, force bool) error
- func (client *ACSClient) ShareBucket(ctx context.Context, bucket string) error
- type HeadBucketOutput
- type HeadObjectOutput
- type ListObjectsOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACSClient ¶
type ACSClient struct {
// contains filtered or unexported fields
}
ACSClient wraps the gRPC connection and client for ObjectStorageCache. It provides high-level operations for interacting with the ACS service.
func NewClient ¶
NewClient initializes a new gRPC client with authentication. It establishes a secure connection to the ACS service, loads credentials, and performs initial authentication. It also checks for key rotation needs. Returns an error if connection, authentication, or credential loading fails.
func (*ACSClient) Close ¶
Close terminates the client connection. It should be called when the client is no longer needed to free resources.
func (*ACSClient) CopyObject ¶
CopyObject copies an object from a source bucket/key to a destination bucket/key. Returns an error if the copy operation fails.
func (*ACSClient) CreateBucket ¶
CreateBucket sends a request to create a new bucket. It requires a bucket name and region specification. Returns an error if the bucket creation fails.
func (*ACSClient) DeleteBucket ¶
DeleteBucket requests deletion of the specified bucket. Returns an error if the bucket deletion fails or the bucket doesn't exist.
func (*ACSClient) DeleteObject ¶
DeleteObject removes a single object from a bucket. Returns an error if the deletion fails.
func (*ACSClient) DeleteObjects ¶
DeleteObjects requests bulk deletion of objects in a bucket. Returns an error if any object deletion fails.
func (*ACSClient) GetObject ¶
GetObject downloads the specified object from the server. Returns the object's data and an error if the download fails.
func (*ACSClient) HeadBucket ¶
HeadBucket retrieves metadata for a specific bucket. Returns the bucket's metadata and an error if the operation fails.
func (*ACSClient) HeadObject ¶
func (client *ACSClient) HeadObject(ctx context.Context, bucket, key string) (*HeadObjectOutput, error)
HeadObject retrieves metadata for a specific object. Returns the object's metadata and an error if the operation fails.
func (*ACSClient) ListBuckets ¶
ListBuckets retrieves all buckets from the server. Returns a list of bucket objects and an error if the operation fails.
func (*ACSClient) ListObjects ¶
func (client *ACSClient) ListObjects(ctx context.Context, bucket string, opts *ListObjectsOptions) ([]string, error)
ListObjects retrieves object keys from the server based on given options. Returns a list of object keys and an error if the operation fails.
func (*ACSClient) PutObject ¶
PutObject uploads data to the specified bucket and key. It automatically handles compression for large objects when beneficial. Returns an error if the upload fails.
type HeadBucketOutput ¶
type HeadBucketOutput struct {
Region string // The region where the bucket is located
}
HeadBucketOutput represents the metadata returned by HeadBucket operation. It contains information about a bucket's configuration and status.
type HeadObjectOutput ¶
type HeadObjectOutput struct { ContentType string // MIME type of the object ContentEncoding string // Encoding of the object content ContentLanguage string // Language the object content is in ContentLength int64 // Size of the object in bytes LastModified time.Time // Last modification timestamp ETag string // Entity tag for the object UserMetadata map[string]string // User-defined metadata key-value pairs ServerSideEncryption string // Type of server-side encryption used VersionId string // Version identifier for the object }
HeadObjectOutput represents the metadata returned by HeadObject operation. It contains detailed information about an object's properties and metadata.
type ListObjectsOptions ¶
type ListObjectsOptions struct { Prefix string // Filter objects by prefix StartAfter string // Return objects lexicographically after this value MaxKeys int32 // Maximum number of keys to return }
ListObjectsOptions holds optional parameters for object listing. These options allow for customizing the object listing operation.