Documentation ¶
Overview ¶
Package objgcp provides an implementation of 'objstore.Client' for use with GCS.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AbortMultipartUpload(ctx context.Context, opts objcli.AbortMultipartUploadOptions) error
- func (c *Client) AppendToObject(ctx context.Context, opts objcli.AppendToObjectOptions) error
- func (c *Client) Close() error
- func (c *Client) CompleteMultipartUpload(ctx context.Context, opts objcli.CompleteMultipartUploadOptions) error
- func (c *Client) CopyObject(ctx context.Context, opts objcli.CopyObjectOptions) error
- func (c *Client) CreateMultipartUpload(_ context.Context, _ objcli.CreateMultipartUploadOptions) (string, error)
- func (c *Client) DeleteDirectory(ctx context.Context, opts objcli.DeleteDirectoryOptions) error
- func (c *Client) DeleteObjects(ctx context.Context, opts objcli.DeleteObjectsOptions) error
- func (c *Client) GetObject(ctx context.Context, opts objcli.GetObjectOptions) (*objval.Object, error)
- func (c *Client) GetObjectAttrs(ctx context.Context, opts objcli.GetObjectAttrsOptions) (*objval.ObjectAttrs, error)
- func (c *Client) IterateObjects(ctx context.Context, opts objcli.IterateObjectsOptions) error
- func (c *Client) ListParts(ctx context.Context, opts objcli.ListPartsOptions) ([]objval.Part, error)
- func (c *Client) Provider() objval.Provider
- func (c *Client) PutObject(ctx context.Context, opts objcli.PutObjectOptions) error
- func (c *Client) UploadPart(ctx context.Context, opts objcli.UploadPartOptions) (objval.Part, error)
- func (c *Client) UploadPartCopy(ctx context.Context, opts objcli.UploadPartCopyOptions) (objval.Part, error)
- type ClientOptions
Constants ¶
const ( // MaxComposable is the hard limit imposed by Google Storage on the maximum number of objects which can be composed // into one, however, note that composed objects may be used as the source for composed objects. MaxComposable = 32 // ChunkSize is the size used for a "resumable" upload in the GCP SDK, required to enable request retries. // // NOTE: Use 8MiB here to reduce the likelihood of triggering resumable uploads in the multipart upload golden path // in 'cbbackupmgr', see MB-53720 for more information. ChunkSize = 8 * 1024 * 1024 // ChunkRetryDeadline is the timeout for uploading a single chunk to GCP, this matches the timeout used in // 'cbbackupmgr' for the object storage HTTP client timeout. ChunkRetryDeadline = 30 * time.Minute )
Variables ¶
var RegexUploadPart = regexp.MustCompile(fmt.Sprintf(`^.*-mpu-%s-%s$`, regexUUID, regexUUID))
RegexUploadPart matches the key for an object created by the GCP client as part of emulating multipart uploads.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the 'objcli.Client' interface allowing the creation/management of objects stored in Google Storage.
func NewClient ¶
func NewClient(options ClientOptions) *Client
NewClient returns a new client which uses the given storage client, in general this should be the one created using the 'storage.NewClient' function exposed by the SDK.
func (*Client) AbortMultipartUpload ¶
func (*Client) AppendToObject ¶
func (*Client) CompleteMultipartUpload ¶
func (*Client) CopyObject ¶
func (*Client) CreateMultipartUpload ¶
func (*Client) DeleteDirectory ¶
func (*Client) DeleteObjects ¶
func (*Client) GetObjectAttrs ¶
func (c *Client) GetObjectAttrs(ctx context.Context, opts objcli.GetObjectAttrsOptions) (*objval.ObjectAttrs, error)
func (*Client) IterateObjects ¶
func (*Client) UploadPart ¶
func (*Client) UploadPartCopy ¶
func (c *Client) UploadPartCopy(ctx context.Context, opts objcli.UploadPartCopyOptions) (objval.Part, error)
NOTE: Google storage does not support byte range copying, therefore, only the entire object may be copied; this may be done by either not providing a byte range, or providing a byte range for the entire object.
type ClientOptions ¶
type ClientOptions struct { // Client is a client for interacting with Google Cloud Storage. // // NOTE: Required Client *storage.Client // Logger is the passed logger which implements a custom Log method Logger *slog.Logger }
ClientOptions encapsulates the options for creating a new GCP Client.