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.
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 ¶
- Variables
- 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 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(ctx context.Context, bucket string, keys []string) error
- func (client *ACSClient) GetObject(ctx context.Context, bucket, key string, options ...GetObjectOption) ([]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 GetObjectOption
- type GetObjectOptions
- type HeadBucketOutput
- type HeadObjectOutput
- type ListObjectsOptions
- type RetryConfig
- type Session
Constants ¶
This section is empty.
Variables ¶
var DefaultRetryConfig = RetryConfig{ MaxAttempts: 5, InitialBackoff: 100 * time.Millisecond, MaxBackoff: 5 * time.Second, BackoffMultipler: 2.0, }
DefaultRetryConfig provides reasonable default values for retry behavior.
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.
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. It 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 and returns an error if bucket creation fails.
func (*ACSClient) DeleteBucket ¶
DeleteBucket requests deletion of the specified bucket. It returns an error if bucket deletion fails or if the bucket doesn't exist.
func (*ACSClient) DeleteObject ¶
DeleteObject removes a single object from a bucket. It returns an error if deletion fails.
func (*ACSClient) DeleteObjects ¶
DeleteObjects requests bulk deletion of objects in a bucket. It returns an error if any object deletion fails.
func (*ACSClient) GetObject ¶
func (client *ACSClient) GetObject(ctx context.Context, bucket, key string, options ...GetObjectOption) ([]byte, error)
GetObject downloads the specified object from the server. If rangeSpec is provided in the format "bytes=start-end" (e.g., "bytes=0-9" for first 10 bytes), only the specified range of the object will be downloaded. It returns the object's data and an error if the download fails.
func (*ACSClient) HeadBucket ¶
HeadBucket retrieves metadata for a specific bucket. It 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. It returns the object's metadata and an error if the operation fails.
func (*ACSClient) ListBuckets ¶
ListBuckets retrieves all buckets from the server. It 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. It 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 compresses large objects when beneficial and returns an error if the upload fails.
type GetObjectOption ¶
type GetObjectOption func(*GetObjectOptions)
GetObjectOption is a function that configures GetObjectOptions
func WithRange ¶
func WithRange(rangeSpec string) GetObjectOption
WithRange specifies a range for the GetObject operation The range should be in the format "bytes=start-end" (e.g., "bytes=0-9" for first 10 bytes)
type GetObjectOptions ¶
type GetObjectOptions struct {
// contains filtered or unexported fields
}
GetObjectOptions holds the options for GetObject
type HeadBucketOutput ¶
type HeadBucketOutput struct { // Region specifies the region where the bucket is located Region string }
HeadBucketOutput represents the metadata returned by HeadBucket operation. It contains information about a bucket's configuration and status.
type HeadObjectOutput ¶
type HeadObjectOutput struct { // ContentType specifies the MIME type of the object ContentType string // ContentEncoding specifies the encoding of the object content ContentEncoding string // ContentLanguage specifies the language the object content is in ContentLanguage string // ContentLength specifies the size of the object in bytes ContentLength int64 // LastModified is the last modification timestamp LastModified time.Time // ETag is the entity tag for the object ETag string // UserMetadata contains user-defined metadata key-value pairs UserMetadata map[string]string // ServerSideEncryption specifies the type of server-side encryption used ServerSideEncryption string // VersionId is the version identifier for the object VersionId string }
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 filters objects by prefix Prefix string // StartAfter returns objects lexicographically after this value StartAfter string // MaxKeys specifies the maximum number of keys to return MaxKeys int32 }
ListObjectsOptions holds optional parameters for object listing. These options allow for customizing the object listing operation.
type RetryConfig ¶
type RetryConfig struct { // MaxAttempts is the maximum number of retry attempts. MaxAttempts int // InitialBackoff is the initial backoff duration. InitialBackoff time.Duration // MaxBackoff is the maximum backoff duration. MaxBackoff time.Duration // BackoffMultipler is the multiplier for exponential backoff. BackoffMultipler float64 }
RetryConfig defines the configuration for retry behavior. It is used by retry logic to configure attempt limits and backoff.