Documentation ¶
Overview ¶
Index ¶
- type AccessConditions
- type DurationType
- type FileAcquireOptions
- type FileAcquireResponse
- type FileBreakOptions
- type FileBreakResponse
- type FileChangeOptions
- type FileChangeResponse
- type FileClient
- func (f *FileClient) Acquire(ctx context.Context, options *FileAcquireOptions) (FileAcquireResponse, error)
- func (f *FileClient) Break(ctx context.Context, options *FileBreakOptions) (FileBreakResponse, error)
- func (f *FileClient) Change(ctx context.Context, proposedLeaseID string, options *FileChangeOptions) (FileChangeResponse, error)
- func (f *FileClient) LeaseID() *string
- func (f *FileClient) Release(ctx context.Context, options *FileReleaseOptions) (FileReleaseResponse, error)
- type FileClientOptions
- type FileReleaseOptions
- type FileReleaseResponse
- type ShareAcquireOptions
- type ShareAcquireResponse
- type ShareBreakOptions
- type ShareBreakResponse
- type ShareChangeOptions
- type ShareChangeResponse
- type ShareClient
- func (s *ShareClient) Acquire(ctx context.Context, duration int32, options *ShareAcquireOptions) (ShareAcquireResponse, error)
- func (s *ShareClient) Break(ctx context.Context, options *ShareBreakOptions) (ShareBreakResponse, error)
- func (s *ShareClient) Change(ctx context.Context, proposedLeaseID string, options *ShareChangeOptions) (ShareChangeResponse, error)
- func (s *ShareClient) LeaseID() *string
- func (s *ShareClient) Release(ctx context.Context, options *ShareReleaseOptions) (ShareReleaseResponse, error)
- func (s *ShareClient) Renew(ctx context.Context, options *ShareRenewOptions) (ShareRenewResponse, error)
- type ShareClientOptions
- type ShareReleaseOptions
- type ShareReleaseResponse
- type ShareRenewOptions
- type ShareRenewResponse
- type StateType
- type StatusType
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessConditions ¶
type AccessConditions = generated.LeaseAccessConditions
AccessConditions contains optional parameters to access leased entity.
type DurationType ¶
type DurationType = generated.LeaseDurationType
DurationType - When a share is leased, specifies whether the lease is of infinite or fixed duration.
const ( DurationTypeInfinite DurationType = generated.LeaseDurationTypeInfinite DurationTypeFixed DurationType = generated.LeaseDurationTypeFixed )
func PossibleDurationTypeValues ¶
func PossibleDurationTypeValues() []DurationType
PossibleDurationTypeValues returns the possible values for the DurationType const type.
type FileAcquireOptions ¶
type FileAcquireOptions struct { }
FileAcquireOptions contains the optional parameters for the FileClient.Acquire method.
type FileAcquireResponse ¶
type FileAcquireResponse = generated.FileClientAcquireLeaseResponse
FileAcquireResponse contains the response from method FileClient.Acquire.
type FileBreakOptions ¶
type FileBreakOptions struct { // AccessConditions contains optional parameters to access leased entity. AccessConditions *AccessConditions }
FileBreakOptions contains the optional parameters for the FileClient.Break method.
type FileBreakResponse ¶
type FileBreakResponse = generated.FileClientBreakLeaseResponse
FileBreakResponse contains the response from method FileClient.Break.
type FileChangeOptions ¶
type FileChangeOptions struct { }
FileChangeOptions contains the optional parameters for the FileClient.Change method.
type FileChangeResponse ¶
type FileChangeResponse = generated.FileClientChangeLeaseResponse
FileChangeResponse contains the response from method FileClient.Change.
type FileClient ¶
type FileClient struct {
// contains filtered or unexported fields
}
FileClient provides lease functionality for the underlying file client.
func NewFileClient ¶
func NewFileClient(client *file.Client, options *FileClientOptions) (*FileClient, error)
NewFileClient creates a file lease client for the provided file client.
- client - an instance of a file client
- options - client options; pass nil to accept the default values
func (*FileClient) Acquire ¶
func (f *FileClient) Acquire(ctx context.Context, options *FileAcquireOptions) (FileAcquireResponse, error)
Acquire operation can be used to request a new lease. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-file.
func (*FileClient) Break ¶
func (f *FileClient) Break(ctx context.Context, options *FileBreakOptions) (FileBreakResponse, error)
Break operation can be used to break the lease, if the file has an active lease. Once a lease is broken, it cannot be renewed. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-file.
func (*FileClient) Change ¶
func (f *FileClient) Change(ctx context.Context, proposedLeaseID string, options *FileChangeOptions) (FileChangeResponse, error)
Change operation can be used to change the lease ID of an active lease. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-file.
func (*FileClient) LeaseID ¶
func (f *FileClient) LeaseID() *string
LeaseID returns leaseID of the client.
func (*FileClient) Release ¶
func (f *FileClient) Release(ctx context.Context, options *FileReleaseOptions) (FileReleaseResponse, error)
Release operation can be used to free the lease if it is no longer needed so that another client may immediately acquire a lease against the file. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-file.
type FileClientOptions ¶
type FileClientOptions struct { // LeaseID contains a caller-provided lease ID. LeaseID *string }
FileClientOptions contains the optional values when creating a FileClient.
type FileReleaseOptions ¶
type FileReleaseOptions struct { }
FileReleaseOptions contains the optional parameters for the FileClient.Release method.
type FileReleaseResponse ¶
type FileReleaseResponse = generated.FileClientReleaseLeaseResponse
FileReleaseResponse contains the response from method FileClient.Release.
type ShareAcquireOptions ¶
type ShareAcquireOptions struct { string }ShareSnapshot *
ShareAcquireOptions contains the optional parameters for the ShareClient.Acquire method.
type ShareAcquireResponse ¶
type ShareAcquireResponse = generated.ShareClientAcquireLeaseResponse
ShareAcquireResponse contains the response from method ShareClient.Acquire.
type ShareBreakOptions ¶
type ShareBreakOptions struct { // break period is only used if it is shorter than the time remaining on the // lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has // expired, but the lease may be held for longer than the break period. If this // header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, // and an infinite lease breaks immediately. BreakPeriod *int32 ShareSnapshot *string AccessConditions *AccessConditions }
ShareBreakOptions contains the optional parameters for the ShareClient.Break method.
type ShareBreakResponse ¶
type ShareBreakResponse = generated.ShareClientBreakLeaseResponse
ShareBreakResponse contains the response from method ShareClient.Break.
type ShareChangeOptions ¶
type ShareChangeOptions struct { string }ShareSnapshot *
ShareChangeOptions contains the optional parameters for the ShareClient.Change method.
type ShareChangeResponse ¶
type ShareChangeResponse = generated.ShareClientChangeLeaseResponse
ShareChangeResponse contains the response from method ShareClient.Change.
type ShareClient ¶
type ShareClient struct {
// contains filtered or unexported fields
}
ShareClient provides lease functionality for the underlying share client.
func NewShareClient ¶
func NewShareClient(client *share.Client, options *ShareClientOptions) (*ShareClient, error)
NewShareClient creates a share lease client for the provided share client.
- client - an instance of a share client
- options - client options; pass nil to accept the default values
func (*ShareClient) Acquire ¶
func (s *ShareClient) Acquire(ctx context.Context, duration int32, options *ShareAcquireOptions) (ShareAcquireResponse, error)
Acquire operation can be used to request a new lease. The lease duration must be between 15 and 60 seconds, or infinite (-1). For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-share.
func (*ShareClient) Break ¶
func (s *ShareClient) Break(ctx context.Context, options *ShareBreakOptions) (ShareBreakResponse, error)
Break operation can be used to break the lease, if the file share has an active lease. Once a lease is broken, it cannot be renewed. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-share.
func (*ShareClient) Change ¶
func (s *ShareClient) Change(ctx context.Context, proposedLeaseID string, options *ShareChangeOptions) (ShareChangeResponse, error)
Change operation can be used to change the lease ID of an active lease. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-share.
func (*ShareClient) LeaseID ¶
func (s *ShareClient) LeaseID() *string
LeaseID returns leaseID of the client.
func (*ShareClient) Release ¶
func (s *ShareClient) Release(ctx context.Context, options *ShareReleaseOptions) (ShareReleaseResponse, error)
Release operation can be used to free the lease if it is no longer needed so that another client may immediately acquire a lease against the file share. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-share.
func (*ShareClient) Renew ¶
func (s *ShareClient) Renew(ctx context.Context, options *ShareRenewOptions) (ShareRenewResponse, error)
Renew operation can be used to renew an existing lease. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-share.
type ShareClientOptions ¶
type ShareClientOptions struct { string }LeaseID *
ShareClientOptions contains the optional values when creating a ShareClient.
type ShareReleaseOptions ¶
type ShareReleaseOptions struct { string }ShareSnapshot *
ShareReleaseOptions contains the optional parameters for the ShareClient.Release method.
type ShareReleaseResponse ¶
type ShareReleaseResponse = generated.ShareClientReleaseLeaseResponse
ShareReleaseResponse contains the response from method ShareClient.Release.
type ShareRenewOptions ¶
type ShareRenewOptions struct { string }ShareSnapshot *
ShareRenewOptions contains the optional parameters for the ShareClient.Renew method.
type ShareRenewResponse ¶
type ShareRenewResponse = generated.ShareClientRenewLeaseResponse
ShareRenewResponse contains the response from method ShareClient.Renew.
type StateType ¶
type StateType = generated.LeaseStateType
StateType - Lease state of the share.
const ( StateTypeAvailable StateType = generated.LeaseStateTypeAvailable StateTypeLeased StateType = generated.LeaseStateTypeLeased StateTypeExpired StateType = generated.LeaseStateTypeExpired StateTypeBreaking StateType = generated.LeaseStateTypeBreaking StateTypeBroken StateType = generated.LeaseStateTypeBroken )
func PossibleStateTypeValues ¶
func PossibleStateTypeValues() []StateType
PossibleStateTypeValues returns the possible values for the StateType const type.
type StatusType ¶
type StatusType = generated.LeaseStatusType
StatusType - The current lease status of the share.
const ( StatusTypeLocked StatusType = generated.LeaseStatusTypeLocked StatusTypeUnlocked StatusType = generated.LeaseStatusTypeUnlocked )
func PossibleStatusTypeValues ¶
func PossibleStatusTypeValues() []StatusType
PossibleStatusTypeValues returns the possible values for the StatusType const type.