Documentation ¶
Overview ¶
Package objazure provides an implementation of 'objstore.Client' for use with Azure blob storage.
Package objazure is a generated GoMock package.
Index ¶
- Constants
- Variables
- func GetServiceClient(accessKeyID, secretAccessKey, endpoint string, options *service.ClientOptions) (*service.Client, error)
- type Client
- func (c *Client) AbortMultipartUpload(_ 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
- type MockblobAPI
- type MockblobAPIMockRecorder
- type MockblockBlobAPI
- func (m *MockblockBlobAPI) CommitBlockList(ctx context.Context, base64BlockIDs []string, ...) (blockblob.CommitBlockListResponse, error)
- func (m *MockblockBlobAPI) Delete(ctx context.Context, options *blob.DeleteOptions) (blob.DeleteResponse, error)
- func (m *MockblockBlobAPI) DownloadStream(ctx context.Context, o *blob.DownloadStreamOptions) (blob.DownloadStreamResponse, error)
- func (m *MockblockBlobAPI) EXPECT() *MockblockBlobAPIMockRecorder
- func (m *MockblockBlobAPI) GetBlockList(ctx context.Context, listType blockblob.BlockListType, ...) (blockblob.GetBlockListResponse, error)
- func (m *MockblockBlobAPI) GetProperties(ctx context.Context, options *blob.GetPropertiesOptions) (blob.GetPropertiesResponse, error)
- func (m *MockblockBlobAPI) StageBlock(ctx context.Context, base64BlockID string, body io.ReadSeekCloser, ...) (blockblob.StageBlockResponse, error)
- func (m *MockblockBlobAPI) StageBlockFromURL(ctx context.Context, base64BlockID, sourceURL string, ...) (blockblob.StageBlockFromURLResponse, error)
- func (m *MockblockBlobAPI) URL() string
- func (m *MockblockBlobAPI) Upload(ctx context.Context, body io.ReadSeekCloser, options *blockblob.UploadOptions) (blockblob.UploadResponse, error)
- type MockblockBlobAPIMockRecorder
- func (mr *MockblockBlobAPIMockRecorder) CommitBlockList(ctx, base64BlockIDs, options interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) Delete(ctx, options interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) DownloadStream(ctx, o interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) GetBlockList(ctx, listType, options interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) GetProperties(ctx, options interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) StageBlock(ctx, base64BlockID, body, options interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) StageBlockFromURL(ctx, base64BlockID, sourceURL, options interface{}) *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) URL() *gomock.Call
- func (mr *MockblockBlobAPIMockRecorder) Upload(ctx, body, options interface{}) *gomock.Call
- type MockcontainerAPI
- func (m *MockcontainerAPI) EXPECT() *MockcontainerAPIMockRecorder
- func (m *MockcontainerAPI) NewBlobClient(blobName string) blobAPI
- func (m *MockcontainerAPI) NewBlockBlobClient(blobName string) blockBlobAPI
- func (m *MockcontainerAPI) NewBlockBlobVersionClient(blobName, versionID string) (blockBlobAPI, error)
- func (m *MockcontainerAPI) NewListBlobsFlatPager(o *container.ListBlobsFlatOptions) flatBlobsPager
- func (m *MockcontainerAPI) NewListBlobsHierarchyPager(delimiter string, o *container.ListBlobsHierarchyOptions) hierarchyBlobsPager
- type MockcontainerAPIMockRecorder
- func (mr *MockcontainerAPIMockRecorder) NewBlobClient(blobName interface{}) *gomock.Call
- func (mr *MockcontainerAPIMockRecorder) NewBlockBlobClient(blobName interface{}) *gomock.Call
- func (mr *MockcontainerAPIMockRecorder) NewBlockBlobVersionClient(blobName, versionID interface{}) *gomock.Call
- func (mr *MockcontainerAPIMockRecorder) NewListBlobsFlatPager(o interface{}) *gomock.Call
- func (mr *MockcontainerAPIMockRecorder) NewListBlobsHierarchyPager(delimiter, o interface{}) *gomock.Call
- type MockflatBlobsPager
- type MockflatBlobsPagerMockRecorder
- type MockhierarchyBlobsPager
- type MockhierarchyBlobsPagerMockRecorder
- type MockserviceAPI
- type MockserviceAPIMockRecorder
- type TokenCredential
Constants ¶
const PageSize = 5000
PageSize is the default page size used by Azure.
Variables ¶
var ErrFailedToDetermineAccountName = errors.New("failed to determine account name")
ErrFailedToDetermineAccountName is returned in the event that we fail to determine the Azure account name using both the static credentials or the environment.
Functions ¶
func GetServiceClient ¶
func GetServiceClient(accessKeyID, secretAccessKey, endpoint string, options *service.ClientOptions) ( *service.Client, error, )
GetServiceClient returns the Azure Service Client that facilitates all the necessary interactions with the Azure blob storage.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the 'objcli.Client' interface allowing the creation/management of blobs stored in Azure blob store.
func NewClient ¶
func NewClient(options ClientOptions) *Client
NewClient returns a new client which uses the given service client, in general this should be the one created using the 'azblob.NewServiceClient' 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 ¶
type ClientOptions ¶
type ClientOptions struct { // Client represents a URL to the Azure Blob Storage service allowing you to manipulate blob containers. // // NOTE: Required Client *service.Client }
ClientOptions encapsulates the options for creating a new Azure Client.
type MockblobAPI ¶
type MockblobAPI struct {
// contains filtered or unexported fields
}
MockblobAPI is a mock of blobAPI interface.
func NewMockblobAPI ¶
func NewMockblobAPI(ctrl *gomock.Controller) *MockblobAPI
NewMockblobAPI creates a new mock instance.
func (*MockblobAPI) CopyFromURL ¶
func (m *MockblobAPI) CopyFromURL(ctx context.Context, copySource string, o *blob.CopyFromURLOptions) (blob.CopyFromURLResponse, error)
CopyFromURL mocks base method.
func (*MockblobAPI) EXPECT ¶
func (m *MockblobAPI) EXPECT() *MockblobAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockblobAPI) GetSASURL ¶
func (m *MockblobAPI) GetSASURL(permissions sas.BlobPermissions, expiry time.Time, options *blob.GetSASURLOptions) (string, error)
GetSASURL mocks base method.
type MockblobAPIMockRecorder ¶
type MockblobAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockblobAPIMockRecorder is the mock recorder for MockblobAPI.
func (*MockblobAPIMockRecorder) CopyFromURL ¶
func (mr *MockblobAPIMockRecorder) CopyFromURL(ctx, copySource, o interface{}) *gomock.Call
CopyFromURL indicates an expected call of CopyFromURL.
func (*MockblobAPIMockRecorder) GetSASURL ¶
func (mr *MockblobAPIMockRecorder) GetSASURL(permissions, expiry, options interface{}) *gomock.Call
GetSASURL indicates an expected call of GetSASURL.
type MockblockBlobAPI ¶
type MockblockBlobAPI struct {
// contains filtered or unexported fields
}
MockblockBlobAPI is a mock of blockBlobAPI interface.
func NewMockblockBlobAPI ¶
func NewMockblockBlobAPI(ctrl *gomock.Controller) *MockblockBlobAPI
NewMockblockBlobAPI creates a new mock instance.
func (*MockblockBlobAPI) CommitBlockList ¶
func (m *MockblockBlobAPI) CommitBlockList(ctx context.Context, base64BlockIDs []string, options *blockblob.CommitBlockListOptions) (blockblob.CommitBlockListResponse, error)
CommitBlockList mocks base method.
func (*MockblockBlobAPI) Delete ¶
func (m *MockblockBlobAPI) Delete(ctx context.Context, options *blob.DeleteOptions) (blob.DeleteResponse, error)
Delete mocks base method.
func (*MockblockBlobAPI) DownloadStream ¶
func (m *MockblockBlobAPI) DownloadStream(ctx context.Context, o *blob.DownloadStreamOptions) (blob.DownloadStreamResponse, error)
DownloadStream mocks base method.
func (*MockblockBlobAPI) EXPECT ¶
func (m *MockblockBlobAPI) EXPECT() *MockblockBlobAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockblockBlobAPI) GetBlockList ¶
func (m *MockblockBlobAPI) GetBlockList(ctx context.Context, listType blockblob.BlockListType, options *blockblob.GetBlockListOptions) (blockblob.GetBlockListResponse, error)
GetBlockList mocks base method.
func (*MockblockBlobAPI) GetProperties ¶
func (m *MockblockBlobAPI) GetProperties(ctx context.Context, options *blob.GetPropertiesOptions) (blob.GetPropertiesResponse, error)
GetProperties mocks base method.
func (*MockblockBlobAPI) StageBlock ¶
func (m *MockblockBlobAPI) StageBlock(ctx context.Context, base64BlockID string, body io.ReadSeekCloser, options *blockblob.StageBlockOptions) (blockblob.StageBlockResponse, error)
StageBlock mocks base method.
func (*MockblockBlobAPI) StageBlockFromURL ¶
func (m *MockblockBlobAPI) StageBlockFromURL(ctx context.Context, base64BlockID, sourceURL string, options *blockblob.StageBlockFromURLOptions) (blockblob.StageBlockFromURLResponse, error)
StageBlockFromURL mocks base method.
func (*MockblockBlobAPI) Upload ¶
func (m *MockblockBlobAPI) Upload(ctx context.Context, body io.ReadSeekCloser, options *blockblob.UploadOptions) (blockblob.UploadResponse, error)
Upload mocks base method.
type MockblockBlobAPIMockRecorder ¶
type MockblockBlobAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockblockBlobAPIMockRecorder is the mock recorder for MockblockBlobAPI.
func (*MockblockBlobAPIMockRecorder) CommitBlockList ¶
func (mr *MockblockBlobAPIMockRecorder) CommitBlockList(ctx, base64BlockIDs, options interface{}) *gomock.Call
CommitBlockList indicates an expected call of CommitBlockList.
func (*MockblockBlobAPIMockRecorder) Delete ¶
func (mr *MockblockBlobAPIMockRecorder) Delete(ctx, options interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockblockBlobAPIMockRecorder) DownloadStream ¶
func (mr *MockblockBlobAPIMockRecorder) DownloadStream(ctx, o interface{}) *gomock.Call
DownloadStream indicates an expected call of DownloadStream.
func (*MockblockBlobAPIMockRecorder) GetBlockList ¶
func (mr *MockblockBlobAPIMockRecorder) GetBlockList(ctx, listType, options interface{}) *gomock.Call
GetBlockList indicates an expected call of GetBlockList.
func (*MockblockBlobAPIMockRecorder) GetProperties ¶
func (mr *MockblockBlobAPIMockRecorder) GetProperties(ctx, options interface{}) *gomock.Call
GetProperties indicates an expected call of GetProperties.
func (*MockblockBlobAPIMockRecorder) StageBlock ¶
func (mr *MockblockBlobAPIMockRecorder) StageBlock(ctx, base64BlockID, body, options interface{}) *gomock.Call
StageBlock indicates an expected call of StageBlock.
func (*MockblockBlobAPIMockRecorder) StageBlockFromURL ¶
func (mr *MockblockBlobAPIMockRecorder) StageBlockFromURL(ctx, base64BlockID, sourceURL, options interface{}) *gomock.Call
StageBlockFromURL indicates an expected call of StageBlockFromURL.
func (*MockblockBlobAPIMockRecorder) URL ¶
func (mr *MockblockBlobAPIMockRecorder) URL() *gomock.Call
URL indicates an expected call of URL.
func (*MockblockBlobAPIMockRecorder) Upload ¶
func (mr *MockblockBlobAPIMockRecorder) Upload(ctx, body, options interface{}) *gomock.Call
Upload indicates an expected call of Upload.
type MockcontainerAPI ¶
type MockcontainerAPI struct {
// contains filtered or unexported fields
}
MockcontainerAPI is a mock of containerAPI interface.
func NewMockcontainerAPI ¶
func NewMockcontainerAPI(ctrl *gomock.Controller) *MockcontainerAPI
NewMockcontainerAPI creates a new mock instance.
func (*MockcontainerAPI) EXPECT ¶
func (m *MockcontainerAPI) EXPECT() *MockcontainerAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockcontainerAPI) NewBlobClient ¶
func (m *MockcontainerAPI) NewBlobClient(blobName string) blobAPI
NewBlobClient mocks base method.
func (*MockcontainerAPI) NewBlockBlobClient ¶
func (m *MockcontainerAPI) NewBlockBlobClient(blobName string) blockBlobAPI
NewBlockBlobClient mocks base method.
func (*MockcontainerAPI) NewBlockBlobVersionClient ¶ added in v5.0.2
func (m *MockcontainerAPI) NewBlockBlobVersionClient(blobName, versionID string) (blockBlobAPI, error)
NewBlockBlobVersionClient mocks base method.
func (*MockcontainerAPI) NewListBlobsFlatPager ¶
func (m *MockcontainerAPI) NewListBlobsFlatPager(o *container.ListBlobsFlatOptions) flatBlobsPager
NewListBlobsFlatPager mocks base method.
func (*MockcontainerAPI) NewListBlobsHierarchyPager ¶
func (m *MockcontainerAPI) NewListBlobsHierarchyPager(delimiter string, o *container.ListBlobsHierarchyOptions) hierarchyBlobsPager
NewListBlobsHierarchyPager mocks base method.
type MockcontainerAPIMockRecorder ¶
type MockcontainerAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockcontainerAPIMockRecorder is the mock recorder for MockcontainerAPI.
func (*MockcontainerAPIMockRecorder) NewBlobClient ¶
func (mr *MockcontainerAPIMockRecorder) NewBlobClient(blobName interface{}) *gomock.Call
NewBlobClient indicates an expected call of NewBlobClient.
func (*MockcontainerAPIMockRecorder) NewBlockBlobClient ¶
func (mr *MockcontainerAPIMockRecorder) NewBlockBlobClient(blobName interface{}) *gomock.Call
NewBlockBlobClient indicates an expected call of NewBlockBlobClient.
func (*MockcontainerAPIMockRecorder) NewBlockBlobVersionClient ¶ added in v5.0.2
func (mr *MockcontainerAPIMockRecorder) NewBlockBlobVersionClient(blobName, versionID interface{}) *gomock.Call
NewBlockBlobVersionClient indicates an expected call of NewBlockBlobVersionClient.
func (*MockcontainerAPIMockRecorder) NewListBlobsFlatPager ¶
func (mr *MockcontainerAPIMockRecorder) NewListBlobsFlatPager(o interface{}) *gomock.Call
NewListBlobsFlatPager indicates an expected call of NewListBlobsFlatPager.
func (*MockcontainerAPIMockRecorder) NewListBlobsHierarchyPager ¶
func (mr *MockcontainerAPIMockRecorder) NewListBlobsHierarchyPager(delimiter, o interface{}) *gomock.Call
NewListBlobsHierarchyPager indicates an expected call of NewListBlobsHierarchyPager.
type MockflatBlobsPager ¶
type MockflatBlobsPager struct {
// contains filtered or unexported fields
}
MockflatBlobsPager is a mock of flatBlobsPager interface.
func NewMockflatBlobsPager ¶
func NewMockflatBlobsPager(ctrl *gomock.Controller) *MockflatBlobsPager
NewMockflatBlobsPager creates a new mock instance.
func (*MockflatBlobsPager) EXPECT ¶
func (m *MockflatBlobsPager) EXPECT() *MockflatBlobsPagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockflatBlobsPager) NextPage ¶
func (m *MockflatBlobsPager) NextPage(ctx context.Context) (azblob.ListBlobsFlatResponse, error)
NextPage mocks base method.
type MockflatBlobsPagerMockRecorder ¶
type MockflatBlobsPagerMockRecorder struct {
// contains filtered or unexported fields
}
MockflatBlobsPagerMockRecorder is the mock recorder for MockflatBlobsPager.
func (*MockflatBlobsPagerMockRecorder) More ¶
func (mr *MockflatBlobsPagerMockRecorder) More() *gomock.Call
More indicates an expected call of More.
func (*MockflatBlobsPagerMockRecorder) NextPage ¶
func (mr *MockflatBlobsPagerMockRecorder) NextPage(ctx interface{}) *gomock.Call
NextPage indicates an expected call of NextPage.
type MockhierarchyBlobsPager ¶
type MockhierarchyBlobsPager struct {
// contains filtered or unexported fields
}
MockhierarchyBlobsPager is a mock of hierarchyBlobsPager interface.
func NewMockhierarchyBlobsPager ¶
func NewMockhierarchyBlobsPager(ctrl *gomock.Controller) *MockhierarchyBlobsPager
NewMockhierarchyBlobsPager creates a new mock instance.
func (*MockhierarchyBlobsPager) EXPECT ¶
func (m *MockhierarchyBlobsPager) EXPECT() *MockhierarchyBlobsPagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockhierarchyBlobsPager) More ¶
func (m *MockhierarchyBlobsPager) More() bool
More mocks base method.
func (*MockhierarchyBlobsPager) NextPage ¶
func (m *MockhierarchyBlobsPager) NextPage(ctx context.Context) (container.ListBlobsHierarchyResponse, error)
NextPage mocks base method.
type MockhierarchyBlobsPagerMockRecorder ¶
type MockhierarchyBlobsPagerMockRecorder struct {
// contains filtered or unexported fields
}
MockhierarchyBlobsPagerMockRecorder is the mock recorder for MockhierarchyBlobsPager.
func (*MockhierarchyBlobsPagerMockRecorder) More ¶
func (mr *MockhierarchyBlobsPagerMockRecorder) More() *gomock.Call
More indicates an expected call of More.
func (*MockhierarchyBlobsPagerMockRecorder) NextPage ¶
func (mr *MockhierarchyBlobsPagerMockRecorder) NextPage(ctx interface{}) *gomock.Call
NextPage indicates an expected call of NextPage.
type MockserviceAPI ¶
type MockserviceAPI struct {
// contains filtered or unexported fields
}
MockserviceAPI is a mock of serviceAPI interface.
func NewMockserviceAPI ¶
func NewMockserviceAPI(ctrl *gomock.Controller) *MockserviceAPI
NewMockserviceAPI creates a new mock instance.
func (*MockserviceAPI) EXPECT ¶
func (m *MockserviceAPI) EXPECT() *MockserviceAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockserviceAPI) NewContainerClient ¶
func (m *MockserviceAPI) NewContainerClient(containerName string) containerAPI
NewContainerClient mocks base method.
type MockserviceAPIMockRecorder ¶
type MockserviceAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockserviceAPIMockRecorder is the mock recorder for MockserviceAPI.
func (*MockserviceAPIMockRecorder) NewContainerClient ¶
func (mr *MockserviceAPIMockRecorder) NewContainerClient(containerName interface{}) *gomock.Call
NewContainerClient indicates an expected call of NewContainerClient.
type TokenCredential ¶
type TokenCredential struct {
// contains filtered or unexported fields
}
TokenCredential wraps/sets up the 'ChainedTokenCredential' structure for env/imds credentials; this was explicitly added to extend the timeout for the IMDS request in the SDK.
func NewTokenCredential ¶
func NewTokenCredential() (*TokenCredential, error)
NewTokenCredential returns an initialized 'TokenCredential', will return an error if none of the expected credentials are available.
func (*TokenCredential) GetToken ¶
func (t *TokenCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error)
GetToken implements the SDK 'TokenCredential' interface.