objazure

package
v5.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

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

View Source
const PageSize = 5000

PageSize is the default page size used by Azure.

Variables

View Source
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 (c *Client) AbortMultipartUpload(_ context.Context, opts objcli.AbortMultipartUploadOptions) error

func (*Client) AppendToObject

func (c *Client) AppendToObject(ctx context.Context, opts objcli.AppendToObjectOptions) error

func (*Client) Close

func (c *Client) Close() error

Close is a no-op for Azure as this won't result in a memory leak.

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(ctx context.Context, opts objcli.CompleteMultipartUploadOptions) error

func (*Client) CopyObject

func (c *Client) CopyObject(ctx context.Context, opts objcli.CopyObjectOptions) error

func (*Client) CreateMultipartUpload

func (c *Client) CreateMultipartUpload(_ context.Context, _ objcli.CreateMultipartUploadOptions) (string, error)

func (*Client) DeleteDirectory

func (c *Client) DeleteDirectory(ctx context.Context, opts objcli.DeleteDirectoryOptions) error

func (*Client) DeleteObjects

func (c *Client) DeleteObjects(ctx context.Context, opts objcli.DeleteObjectsOptions) error

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, opts objcli.GetObjectOptions) (*objval.Object, error)

func (*Client) GetObjectAttrs

func (c *Client) GetObjectAttrs(ctx context.Context, opts objcli.GetObjectAttrsOptions) (*objval.ObjectAttrs, error)

func (*Client) IterateObjects

func (c *Client) IterateObjects(ctx context.Context, opts objcli.IterateObjectsOptions) error

func (*Client) ListParts

func (c *Client) ListParts(ctx context.Context, opts objcli.ListPartsOptions) ([]objval.Part, error)

func (*Client) Provider

func (c *Client) Provider() objval.Provider

func (*Client) PutObject

func (c *Client) PutObject(ctx context.Context, opts objcli.PutObjectOptions) error

func (*Client) UploadPart

func (c *Client) UploadPart(ctx context.Context, opts objcli.UploadPartOptions) (objval.Part, error)

func (*Client) UploadPartCopy

func (c *Client) UploadPartCopy(ctx context.Context, opts objcli.UploadPartCopyOptions) (objval.Part, error)

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

Delete mocks base method.

func (*MockblockBlobAPI) DownloadStream

DownloadStream mocks base method.

func (*MockblockBlobAPI) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockblockBlobAPI) GetBlockList

GetBlockList mocks base method.

func (*MockblockBlobAPI) GetProperties

GetProperties mocks base method.

func (*MockblockBlobAPI) StageBlock

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) URL

func (m *MockblockBlobAPI) URL() string

URL mocks base method.

func (*MockblockBlobAPI) Upload

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

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

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

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockflatBlobsPager) More

func (m *MockflatBlobsPager) More() bool

More mocks base method.

func (*MockflatBlobsPager) NextPage

NextPage mocks base method.

type MockflatBlobsPagerMockRecorder

type MockflatBlobsPagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockflatBlobsPagerMockRecorder is the mock recorder for MockflatBlobsPager.

func (*MockflatBlobsPagerMockRecorder) More

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

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

NextPage mocks base method.

type MockhierarchyBlobsPagerMockRecorder

type MockhierarchyBlobsPagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockhierarchyBlobsPagerMockRecorder is the mock recorder for MockhierarchyBlobsPager.

func (*MockhierarchyBlobsPagerMockRecorder) More

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

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

GetToken implements the SDK 'TokenCredential' interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL