Documentation
¶
Index ¶
- Constants
- type BlobClient
- func New(authorizer autorest.Authorizer) *BlobClient
- func NewMsiBlobProviderWithClientID(clientID string) (*BlobClient, error)
- func NewMsiBlobProviderWithMiResourceID(miResID string) (*BlobClient, error)
- func NewMsiBlobProviderWithMiResourceIDWithCloudName(miResID string, cloudName string) (*BlobClient, error)
- func (c *BlobClient) AcquireLease(ctx context.Context, storageAccountName, containerName, blobName string, ...) (string, error)
- func (c *BlobClient) BlobExists(ctx context.Context, storageAccountName, containerName, blobName string) (bool, error)
- func (c *BlobClient) BreakLease(ctx context.Context, ...) error
- func (c *BlobClient) ContainerExists(ctx context.Context, storageAccountName, containerName string) (bool, error)
- func (c *BlobClient) CreateContainer(ctx context.Context, storageAccountName, containerName string) error
- func (c *BlobClient) CreateContainerWithACL(ctx context.Context, storageAccountName, containerName string, ...) error
- func (c *BlobClient) DeleteContainer(ctx context.Context, storageAccountName, containerName string) error
- func (c *BlobClient) GetBlobData(ctx context.Context, url string) ([]byte, error)
- func (c *BlobClient) GetBlobDataV1(ctx context.Context, storageAccountName, containerName, blobName string) ([]byte, int, error)
- func (c *BlobClient) ListBlobsWithPrefix(ctx context.Context, url, prefix string) (storage.BlobListResponse, error)
- func (c *BlobClient) PutBlobData(ctx context.Context, url string, data []byte) error
- func (c *BlobClient) PutBlobDataV1(ctx context.Context, storageAccountName, containerName, blobName string, ...) error
- func (c *BlobClient) ReleaseLease(ctx context.Context, ...) error
- type BlobPublicAccessLevel
- type Interface
Constants ¶
View Source
const HeaderLeaseID = "x-ms-lease-id"
HeaderLeaseID - specify the header name for operation lease id.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlobClient ¶
type BlobClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(authorizer autorest.Authorizer) *BlobClient
func NewMsiBlobProviderWithClientID ¶
func NewMsiBlobProviderWithClientID(clientID string) (*BlobClient, error)
func NewMsiBlobProviderWithMiResourceID ¶
func NewMsiBlobProviderWithMiResourceID(miResID string) (*BlobClient, error)
func NewMsiBlobProviderWithMiResourceIDWithCloudName ¶
func NewMsiBlobProviderWithMiResourceIDWithCloudName(miResID string, cloudName string) (*BlobClient, error)
func (*BlobClient) AcquireLease ¶
func (*BlobClient) BlobExists ¶
func (c *BlobClient) BlobExists(ctx context.Context, storageAccountName, containerName, blobName string) (bool, error)
BlobExists checks if a blob exist. ref: https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties
func (*BlobClient) BreakLease ¶
func (c *BlobClient) BreakLease(ctx context.Context, storageAccountName, containerName, blobName, leaseID string) error
func (*BlobClient) ContainerExists ¶
func (*BlobClient) CreateContainer ¶
func (c *BlobClient) CreateContainer(ctx context.Context, storageAccountName, containerName string) error
func (*BlobClient) CreateContainerWithACL ¶
func (c *BlobClient) CreateContainerWithACL(ctx context.Context, storageAccountName, containerName string, acl BlobPublicAccessLevel) error
func (*BlobClient) DeleteContainer ¶
func (c *BlobClient) DeleteContainer(ctx context.Context, storageAccountName, containerName string) error
func (*BlobClient) GetBlobData ¶
GetBlobData gets data from blob with URL
func (*BlobClient) GetBlobDataV1 ¶
func (c *BlobClient) GetBlobDataV1(ctx context.Context, storageAccountName, containerName, blobName string) ([]byte, int, error)
GetBlobData gets data from blob with URL
func (*BlobClient) ListBlobsWithPrefix ¶
func (c *BlobClient) ListBlobsWithPrefix(ctx context.Context, url, prefix string) (storage.BlobListResponse, error)
ListBlobsWithPrefix lists blobs with URL and prefix
func (*BlobClient) PutBlobData ¶
PutBlobData put data to blob with URL
func (*BlobClient) PutBlobDataV1 ¶
func (c *BlobClient) PutBlobDataV1(ctx context.Context, storageAccountName, containerName, blobName string, data []byte, extraHeaders map[string]interface{}) error
PutBlobDataV1 gets data from blob with URL
func (*BlobClient) ReleaseLease ¶
func (c *BlobClient) ReleaseLease(ctx context.Context, storageAccountName, containerName, blobName, leaseID string) error
type BlobPublicAccessLevel ¶
type BlobPublicAccessLevel string
BlobPublicAccessLevel specifies the storage account blob public access level. ref: https://docs.microsoft.com/en-us/rest/api/storageservices/create-container
const ( // BlobPublicAccessLevelNotSet - default ACL, private to the account owner BlobPublicAccessLevelNotSet BlobPublicAccessLevel = "" // BlobPublicAccessLevelContainer - specifies full public read access for container and blob data. BlobPublicAccessLevelContainer BlobPublicAccessLevel = "container" // BlobPublicAccessLevelBlob - specifies public read access for blobs. BlobPublicAccessLevelBlob BlobPublicAccessLevel = "blob" )
type Interface ¶
type Interface interface { GetBlobData(ctx context.Context, url string) ([]byte, error) GetBlobDataV1(ctx context.Context, storageAccountName, containerName, blobName string) ([]byte, int, error) BlobExists(ctx context.Context, storageAccountName, containerName, blobName string) (bool, error) PutBlobData(ctx context.Context, url string, data []byte) error PutBlobDataV1(ctx context.Context, storageAccountName, containerName, blobName string, data []byte, extraHeaders map[string]interface{}) error ListBlobsWithPrefix(ctx context.Context, url, prefix string) (storage.BlobListResponse, error) ContainerExists(ctx context.Context, storageAccountName, containerName string) (bool, error) DeleteContainer(ctx context.Context, storageAccountName, containerName string) error CreateContainer(ctx context.Context, storageAccountName, containerName string) error CreateContainerWithACL(ctx context.Context, storageAccountName, containerName string, acl BlobPublicAccessLevel) error AcquireLease(ctx context.Context, storageAccountName, containerName, blobName string, durationInSeconds uint) (string, error) ReleaseLease(ctx context.Context, storageAccountName, containerName, blobName, leaseID string) error BreakLease(ctx context.Context, storageAccountName, containerName, blobName, leaseID string) error }
Interface blob client APIs
Directories
¶
Path | Synopsis |
---|---|
Package mock_blobclient is a generated GoMock package.
|
Package mock_blobclient is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.