Documentation ¶
Overview ¶
Index ¶
- type AccessPolicy
- type AccessPolicyPermission
- type AccessTier
- type Client
- func NewClient(shareURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error)
- func NewClientFromConnectionString(connectionString string, shareName string, options *ClientOptions) (*Client, error)
- func NewClientWithNoCredential(shareURL string, options *ClientOptions) (*Client, error)
- func NewClientWithSharedKeyCredential(shareURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error)
- func (s *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)
- func (s *Client) CreatePermission(ctx context.Context, sharePermission string, options *CreatePermissionOptions) (CreatePermissionResponse, error)
- func (s *Client) CreateSnapshot(ctx context.Context, options *CreateSnapshotOptions) (CreateSnapshotResponse, error)
- func (s *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)
- func (s *Client) GetAccessPolicy(ctx context.Context, options *GetAccessPolicyOptions) (GetAccessPolicyResponse, error)
- func (s *Client) GetPermission(ctx context.Context, filePermissionKey string, options *GetPermissionOptions) (GetPermissionResponse, error)
- func (s *Client) GetProperties(ctx context.Context, options *GetPropertiesOptions) (GetPropertiesResponse, error)
- func (s *Client) GetSASURL(permissions sas.SharePermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
- func (s *Client) GetStatistics(ctx context.Context, options *GetStatisticsOptions) (GetStatisticsResponse, error)
- func (s *Client) NewDirectoryClient(directoryName string) *directory.Client
- func (s *Client) NewRootDirectoryClient() *directory.Client
- func (s *Client) Restore(ctx context.Context, deletedShareVersion string, options *RestoreOptions) (RestoreResponse, error)
- func (s *Client) SetAccessPolicy(ctx context.Context, options *SetAccessPolicyOptions) (SetAccessPolicyResponse, error)
- func (s *Client) SetMetadata(ctx context.Context, options *SetMetadataOptions) (SetMetadataResponse, error)
- func (s *Client) SetProperties(ctx context.Context, options *SetPropertiesOptions) (SetPropertiesResponse, error)
- func (s *Client) URL() string
- func (s *Client) WithSnapshot(shareSnapshot string) (*Client, error)
- type ClientOptions
- type CreateOptions
- type CreatePermissionOptions
- type CreatePermissionResponse
- type CreateResponse
- type CreateSnapshotOptions
- type CreateSnapshotResponse
- type DeleteOptions
- type DeleteResponse
- type DeleteSnapshotsOptionType
- type GetAccessPolicyOptions
- type GetAccessPolicyResponse
- type GetPermissionOptions
- type GetPermissionResponse
- type GetPropertiesOptions
- type GetPropertiesResponse
- type GetSASURLOptions
- type GetStatisticsOptions
- type GetStatisticsResponse
- type LeaseAccessConditions
- type Permission
- type PermissionFormat
- type RestoreOptions
- type RestoreResponse
- type RootSquash
- type SetAccessPolicyOptions
- type SetAccessPolicyResponse
- type SetMetadataOptions
- type SetMetadataResponse
- type SetPropertiesOptions
- type SetPropertiesResponse
- type SharedKeyCredential
- type SignedIdentifier
- type Stats
- type TokenIntent
Examples ¶
- Package (Share_Client_AccessPolicy)
- Package (Share_Client_Create)
- Package (Share_Client_CreateAndGetPermissionOAuth)
- Package (Share_Client_CreateGetPermission)
- Package (Share_Client_CreateSnapshot)
- Package (Share_Client_Delete)
- Package (Share_Client_GetProperties)
- Package (Share_Client_GetSASURL)
- Package (Share_Client_GetStatistics)
- Package (Share_Client_NewClient)
- Package (Share_Client_NewClientFromConnectionString)
- Package (Share_Client_NewDirectoryClient)
- Package (Share_Client_NewRootDirectoryClient)
- Package (Share_Client_Restore)
- Package (Share_Client_SetMetadata)
- Package (Share_Client_SetProperties)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessPolicyPermission ¶
type AccessPolicyPermission = exported.AccessPolicyPermission
AccessPolicyPermission type simplifies creating the permissions string for a share's access policy. Initialize an instance of this type and then call its String method to set AccessPolicy's permission field.
type AccessTier ¶
type AccessTier = generated.ShareAccessTier
AccessTier defines values for the access tier of the share.
const ( AccessTierCool AccessTier = generated.ShareAccessTierCool AccessTierHot AccessTier = generated.ShareAccessTierHot AccessTierTransactionOptimized AccessTier = generated.ShareAccessTierTransactionOptimized )
func PossibleAccessTierValues ¶
func PossibleAccessTierValues() []AccessTier
PossibleAccessTierValues returns the possible values for the AccessTier const type.
type Client ¶
type Client base.Client[generated.ShareClient]
Client represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
func NewClient ¶
func NewClient(shareURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error)
NewClient creates an instance of Client with the specified values.
- shareURL - the URL of the share e.g. https://<account>.file.core.windows.net/share
- cred - an Azure AD credential, typically obtained via the azidentity module
- options - client options; pass nil to accept the default values
Note that the only share-level operations that support token credential authentication are CreatePermission and GetPermission. Also note that ClientOptions.FileRequestIntent is currently required for token authentication.
func NewClientFromConnectionString ¶
func NewClientFromConnectionString(connectionString string, shareName string, options *ClientOptions) (*Client, error)
NewClientFromConnectionString creates an instance of Client with the specified values.
- connectionString - a connection string for the desired storage account
- shareName - the name of the share within the storage account
- options - client options; pass nil to accept the default values
func NewClientWithNoCredential ¶
func NewClientWithNoCredential(shareURL string, options *ClientOptions) (*Client, error)
NewClientWithNoCredential creates an instance of Client with the specified values. This is used to anonymously access a share or with a shared access signature (SAS) token.
- shareURL - the URL of the share e.g. https://<account>.file.core.windows.net/share?<sas token>
- options - client options; pass nil to accept the default values
func NewClientWithSharedKeyCredential ¶
func NewClientWithSharedKeyCredential(shareURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error)
NewClientWithSharedKeyCredential creates an instance of Client with the specified values.
- shareURL - the URL of the share e.g. https://<account>.file.core.windows.net/share
- cred - a SharedKeyCredential created with the matching share's storage account and access key
- options - client options; pass nil to accept the default values
func (*Client) Create ¶
func (s *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)
Create operation creates a new share within a storage account. If a share with the same name already exists, the operation fails. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/create-share.
func (*Client) CreatePermission ¶
func (s *Client) CreatePermission(ctx context.Context, sharePermission string, options *CreatePermissionOptions) (CreatePermissionResponse, error)
CreatePermission operation creates a permission (a security descriptor) at the share level. The created security descriptor can be used for the files and directories in the share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/create-permission.
func (*Client) CreateSnapshot ¶
func (s *Client) CreateSnapshot(ctx context.Context, options *CreateSnapshotOptions) (CreateSnapshotResponse, error)
CreateSnapshot operation creates a read-only snapshot of a share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/snapshot-share.
func (*Client) Delete ¶
func (s *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)
Delete operation marks the specified share for deletion. The share and any files contained within it are later deleted during garbage collection. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-share.
func (*Client) GetAccessPolicy ¶
func (s *Client) GetAccessPolicy(ctx context.Context, options *GetAccessPolicyOptions) (GetAccessPolicyResponse, error)
GetAccessPolicy operation returns information about stored access policies specified on the share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-acl.
func (*Client) GetPermission ¶
func (s *Client) GetPermission(ctx context.Context, filePermissionKey string, options *GetPermissionOptions) (GetPermissionResponse, error)
GetPermission operation gets the SDDL permission string from the service using a known permission key. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-permission.
func (*Client) GetProperties ¶
func (s *Client) GetProperties(ctx context.Context, options *GetPropertiesOptions) (GetPropertiesResponse, error)
GetProperties operation returns all user-defined metadata and system properties for the specified share or share snapshot. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-properties.
func (*Client) GetSASURL ¶
func (s *Client) GetSASURL(permissions sas.SharePermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
GetSASURL is a convenience method for generating a SAS token for the currently pointed at share. It can only be used if the credential supplied during creation was a SharedKeyCredential.
func (*Client) GetStatistics ¶
func (s *Client) GetStatistics(ctx context.Context, options *GetStatisticsOptions) (GetStatisticsResponse, error)
GetStatistics operation retrieves statistics related to the share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-stats.
func (*Client) NewDirectoryClient ¶
NewDirectoryClient creates a new directory.Client object by concatenating directoryName to the end of this Client's URL. The new directory.Client uses the same request policy pipeline as the Client.
func (*Client) NewRootDirectoryClient ¶
NewRootDirectoryClient creates a new directory.Client object for the root of the share using the Client's URL. The new directory.Client uses the same request policy pipeline as the Client.
func (*Client) Restore ¶
func (s *Client) Restore(ctx context.Context, deletedShareVersion string, options *RestoreOptions) (RestoreResponse, error)
Restore operation restores a share that had previously been soft-deleted. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/restore-share.
func (*Client) SetAccessPolicy ¶
func (s *Client) SetAccessPolicy(ctx context.Context, options *SetAccessPolicyOptions) (SetAccessPolicyResponse, error)
SetAccessPolicy operation sets a stored access policy for use with shared access signatures. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-acl.
func (*Client) SetMetadata ¶
func (s *Client) SetMetadata(ctx context.Context, options *SetMetadataOptions) (SetMetadataResponse, error)
SetMetadata operation sets one or more user-defined name-value pairs for the specified share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-metadata.
func (*Client) SetProperties ¶
func (s *Client) SetProperties(ctx context.Context, options *SetPropertiesOptions) (SetPropertiesResponse, error)
SetProperties operation sets properties for the specified share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-properties.
type ClientOptions ¶
type ClientOptions base.ClientOptions
ClientOptions contains the optional parameters when creating a Client.
type CreateOptions ¶
type CreateOptions struct { // Specifies the access tier of the share. AccessTier *AccessTier // Protocols to enable on the share. EnabledProtocols *string // A name-value pair to associate with a file storage object. Metadata map[string]*string // Specifies the maximum size of the share, in gigabytes. Quota *int32 // Root squash to set on the share. Only valid for NFS shares. RootSquash *RootSquash // Specifies whether the snapshot virtual directory should be accessible at the root of share mount point // when NFS is enabled. EnableSnapshotVirtualDirectoryAccess *bool // Optional. Boolean. Default if not specified is false. This property enables paid bursting. PaidBurstingEnabled *bool // Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a // file share is 10,340 MiB/sec. PaidBurstingMaxBandwidthMibps *int64 // Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file // share is 102,400 IOPS. PaidBurstingMaxIops *int64 }
CreateOptions contains the optional parameters for the Client.Create method.
type CreatePermissionOptions ¶
type CreatePermissionOptions struct { }
CreatePermissionOptions contains the optional parameters for the Client.CreatePermission method.
type CreatePermissionResponse ¶
type CreatePermissionResponse = generated.ShareClientCreatePermissionResponse
CreatePermissionResponse contains the response from method Client.CreatePermission.
type CreateResponse ¶
type CreateResponse = generated.ShareClientCreateResponse
CreateResponse contains the response from method Client.Create.
type CreateSnapshotOptions ¶
type CreateSnapshotOptions struct { // A name-value pair to associate with a file storage object. Metadata map[string]*string }
CreateSnapshotOptions contains the optional parameters for the Client.CreateSnapshot method.
type CreateSnapshotResponse ¶
type CreateSnapshotResponse = generated.ShareClientCreateSnapshotResponse
CreateSnapshotResponse contains the response from method Client.CreateSnapshot.
type DeleteOptions ¶
type DeleteOptions struct { // Specifies the option include to delete the base share and all of its snapshots. DeleteSnapshots *DeleteSnapshotsOptionType ShareSnapshot *string // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions }
DeleteOptions contains the optional parameters for the Client.Delete method.
type DeleteResponse ¶
type DeleteResponse = generated.ShareClientDeleteResponse
DeleteResponse contains the response from method Client.Delete.
type DeleteSnapshotsOptionType ¶
type DeleteSnapshotsOptionType = generated.DeleteSnapshotsOptionType
DeleteSnapshotsOptionType defines values for DeleteSnapshotsOptionType
const ( DeleteSnapshotsOptionTypeInclude DeleteSnapshotsOptionType = generated.DeleteSnapshotsOptionTypeInclude DeleteSnapshotsOptionTypeIncludeLeased DeleteSnapshotsOptionType = generated.DeleteSnapshotsOptionTypeIncludeLeased )
func PossibleDeleteSnapshotsOptionTypeValues ¶
func PossibleDeleteSnapshotsOptionTypeValues() []DeleteSnapshotsOptionType
PossibleDeleteSnapshotsOptionTypeValues returns the possible values for the DeleteSnapshotsOptionType const type.
type GetAccessPolicyOptions ¶
type GetAccessPolicyOptions struct { // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions }
GetAccessPolicyOptions contains the optional parameters for the Client.GetAccessPolicy method.
type GetAccessPolicyResponse ¶
type GetAccessPolicyResponse = generated.ShareClientGetAccessPolicyResponse
GetAccessPolicyResponse contains the response from method Client.GetAccessPolicy.
type GetPermissionOptions ¶
type GetPermissionOptions struct {
FilePermissionFormat *PermissionFormat
}
GetPermissionOptions contains the optional parameters for the Client.GetPermission method.
type GetPermissionResponse ¶
type GetPermissionResponse = generated.ShareClientGetPermissionResponse
GetPermissionResponse contains the response from method Client.GetPermission.
type GetPropertiesOptions ¶
type GetPropertiesOptions struct { string // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions }ShareSnapshot *
GetPropertiesOptions contains the optional parameters for the Client.GetProperties method.
type GetPropertiesResponse ¶
type GetPropertiesResponse = generated.ShareClientGetPropertiesResponse
GetPropertiesResponse contains the response from method Client.GetProperties.
type GetSASURLOptions ¶
GetSASURLOptions contains the optional parameters for the Client.GetSASURL method.
type GetStatisticsOptions ¶
type GetStatisticsOptions struct { // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions }
GetStatisticsOptions contains the optional parameters for the Client.GetStatistics method.
type GetStatisticsResponse ¶
type GetStatisticsResponse = generated.ShareClientGetStatisticsResponse
GetStatisticsResponse contains the response from method Client.GetStatistics.
type LeaseAccessConditions ¶
type LeaseAccessConditions = generated.LeaseAccessConditions
LeaseAccessConditions contains optional parameters to access leased entity.
type Permission ¶
type Permission = generated.SharePermission
Permission - A permission (a security descriptor) at the share level.
type PermissionFormat ¶
type PermissionFormat = generated.FilePermissionFormat
PermissionFormat contains the format of the file permissions, Can be sddl (Default) or Binary.
const ( FilePermissionFormatBinary PermissionFormat = generated.FilePermissionFormatBinary FilePermissionFormatSddl PermissionFormat = generated.FilePermissionFormatSddl )
func PossibleFilePermissionFormatValues ¶
func PossibleFilePermissionFormatValues() []PermissionFormat
PossibleFilePermissionFormatValues returns the possible values for the FilePermissionFormat const type.
type RestoreOptions ¶
type RestoreOptions struct { }
RestoreOptions contains the optional parameters for the Client.Restore method.
type RestoreResponse ¶
type RestoreResponse = generated.ShareClientRestoreResponse
RestoreResponse contains the response from method Client.Restore.
type RootSquash ¶
type RootSquash = generated.ShareRootSquash
RootSquash defines values for the root squashing behavior on the share when NFS is enabled. If it's not specified, the default is NoRootSquash.
const ( RootSquashNoRootSquash RootSquash = generated.ShareRootSquashNoRootSquash RootSquashRootSquash RootSquash = generated.ShareRootSquashRootSquash RootSquashAllSquash RootSquash = generated.ShareRootSquashAllSquash )
func PossibleRootSquashValues ¶
func PossibleRootSquashValues() []RootSquash
PossibleRootSquashValues returns the possible values for the RootSquash const type.
type SetAccessPolicyOptions ¶
type SetAccessPolicyOptions struct { SignedIdentifier // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions }ShareACL []*
SetAccessPolicyOptions contains the optional parameters for the Client.SetAccessPolicy method.
type SetAccessPolicyResponse ¶
type SetAccessPolicyResponse = generated.ShareClientSetAccessPolicyResponse
SetAccessPolicyResponse contains the response from method Client.SetAccessPolicy.
type SetMetadataOptions ¶
type SetMetadataOptions struct { // A name-value pair to associate with a file storage object. Metadata map[string]*string // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions }
SetMetadataOptions contains the optional parameters for the Client.SetMetadata method.
type SetMetadataResponse ¶
type SetMetadataResponse = generated.ShareClientSetMetadataResponse
SetMetadataResponse contains the response from method Client.SetMetadata.
type SetPropertiesOptions ¶
type SetPropertiesOptions struct { // Specifies the access tier of the share. AccessTier *AccessTier // Specifies the maximum size of the share, in gigabytes. Quota *int32 // Root squash to set on the share. Only valid for NFS shares. RootSquash *RootSquash // LeaseAccessConditions contains optional parameters to access leased entity. LeaseAccessConditions *LeaseAccessConditions // Specifies whether the snapshot virtual directory should be accessible at the root of share mount point // when NFS is enabled. EnableSnapshotVirtualDirectoryAccess *bool // Optional. Boolean. Default if not specified is false. This property enables paid bursting. PaidBurstingEnabled *bool // Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a // file share is 10,340 MiB/sec. PaidBurstingMaxBandwidthMibps *int64 // Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file // share is 102,400 IOPS. PaidBurstingMaxIops *int64 }
SetPropertiesOptions contains the optional parameters for the Client.SetProperties method.
type SetPropertiesResponse ¶
type SetPropertiesResponse = generated.ShareClientSetPropertiesResponse
SetPropertiesResponse contains the response from method Client.SetProperties.
type SharedKeyCredential ¶
type SharedKeyCredential = exported.SharedKeyCredential
SharedKeyCredential contains an account's name and its primary or secondary key.
func NewSharedKeyCredential ¶
func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error)
NewSharedKeyCredential creates an immutable SharedKeyCredential containing the storage account's name and either its primary or secondary key.
type SignedIdentifier ¶
type SignedIdentifier = generated.SignedIdentifier
SignedIdentifier - Signed identifier.
type TokenIntent ¶
type TokenIntent = generated.ShareTokenIntent
TokenIntent is required if authorization header specifies an OAuth token.
const (
TokenIntentBackup TokenIntent = generated.ShareTokenIntentBackup
)
func PossibleTokenIntentValues ¶
func PossibleTokenIntentValues() []TokenIntent
PossibleTokenIntentValues returns the possible values for the TokenIntent const type.