Documentation ¶
Index ¶
- Constants
- func ComputeHMACSHA256(cred *SharedKeyCredential, message string) (string, error)
- func FormatHTTPRange(r HTTPRange) *string
- func FormatPermissions(p *Permissions, defaultPermission *string) (*string, *string)
- func FormatSMBProperties(sp *SMBProperties, defaultAttributes *string, defaultCurrentTime *string, ...) (fileAttributes *string, creationTime *string, lastWriteTime *string, ...)
- type AccessPolicyPermission
- type CopyFileAttributes
- type CopyFileChangeTime
- type CopyFileCreationTime
- type CopyFileLastWriteTime
- type DestinationCopyFileAttributes
- type DestinationCopyFileChangeTime
- type DestinationCopyFileCreationTime
- type DestinationCopyFileLastWriteTime
- type HTTPRange
- type NTFSFileAttributes
- type Permissions
- type SMBProperties
- type SharedKeyCredPolicy
- type SharedKeyCredential
- type SourceCopyFileAttributes
- type SourceCopyFileChangeTime
- type SourceCopyFileCreationTime
- type SourceCopyFileLastWriteTime
- type TransferValidationType
- type TransferValidationTypeMD5
Constants ¶
const ( ModuleName = "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile" ModuleVersion = "v1.4.0" )
const ( // EventUpload is used when we compute number of chunks to upload and size of each chunk. EventUpload log.Event = "azfile.Upload" )
NOTE: these are publicly exported via type-aliasing in azfile/log.go
Variables ¶
This section is empty.
Functions ¶
func ComputeHMACSHA256 ¶
func ComputeHMACSHA256(cred *SharedKeyCredential, message string) (string, error)
ComputeHMACSHA256 is a helper for computing the signed string outside of this package.
func FormatHTTPRange ¶
FormatHTTPRange converts an HTTPRange to its string format.
func FormatPermissions ¶ added in v1.1.0
func FormatPermissions(p *Permissions, defaultPermission *string) (*string, *string)
FormatPermissions returns file permission string and permission key.
func FormatSMBProperties ¶ added in v1.1.0
func FormatSMBProperties(sp *SMBProperties, defaultAttributes *string, defaultCurrentTime *string, isDir bool) (fileAttributes *string, creationTime *string, lastWriteTime *string, changeTime *string)
FormatSMBProperties returns file attributes, creation time, last write time and change time.
Types ¶
type AccessPolicyPermission ¶
type AccessPolicyPermission struct {
Read, Create, Write, Delete, List bool
}
The 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.
func (*AccessPolicyPermission) Parse ¶
func (p *AccessPolicyPermission) Parse(s string) error
Parse initializes the AccessPolicyPermission's fields from a string.
func (AccessPolicyPermission) String ¶
func (p AccessPolicyPermission) String() string
String produces the access policy permission string for an Azure Storage share. Call this method to set AccessPolicy's Permission field.
type CopyFileAttributes ¶
type CopyFileAttributes interface { FormatAttributes() *string // contains filtered or unexported methods }
CopyFileAttributes specifies either the option to copy file attributes from a source file(source) to a target file or a list of attributes to set on a target file.
type CopyFileChangeTime ¶ added in v1.1.0
type CopyFileChangeTime interface { FormatChangeTime() *string // contains filtered or unexported methods }
CopyFileChangeTime specifies either the option to copy file change time from a source file(source) to a target file or a time value in ISO 8601 format to set as change time on a target file.
type CopyFileCreationTime ¶
type CopyFileCreationTime interface { FormatCreationTime() *string // contains filtered or unexported methods }
CopyFileCreationTime specifies either the option to copy file creation time from a source file(source) to a target file or a time value in ISO 8601 format to set as creation time on a target file.
type CopyFileLastWriteTime ¶
type CopyFileLastWriteTime interface { FormatLastWriteTime() *string // contains filtered or unexported methods }
CopyFileLastWriteTime specifies either the option to copy file last write time from a source file(source) to a target file or a time value in ISO 8601 format to set as last write time on a target file.
type DestinationCopyFileAttributes ¶
type DestinationCopyFileAttributes NTFSFileAttributes
DestinationCopyFileAttributes specifies a list of attributes to set on a target file.
func (DestinationCopyFileAttributes) FormatAttributes ¶
func (d DestinationCopyFileAttributes) FormatAttributes() *string
type DestinationCopyFileChangeTime ¶ added in v1.1.0
DestinationCopyFileChangeTime specifies a time value in ISO 8601 format to set as change time on a target file.
func (DestinationCopyFileChangeTime) FormatChangeTime ¶ added in v1.1.0
func (d DestinationCopyFileChangeTime) FormatChangeTime() *string
type DestinationCopyFileCreationTime ¶
DestinationCopyFileCreationTime specifies a time value in ISO 8601 format to set as creation time on a target file.
func (DestinationCopyFileCreationTime) FormatCreationTime ¶
func (d DestinationCopyFileCreationTime) FormatCreationTime() *string
type DestinationCopyFileLastWriteTime ¶
DestinationCopyFileLastWriteTime specifies a time value in ISO 8601 format to set as last write time on a target file.
func (DestinationCopyFileLastWriteTime) FormatLastWriteTime ¶
func (d DestinationCopyFileLastWriteTime) FormatLastWriteTime() *string
type HTTPRange ¶
HTTPRange defines a range of bytes within an HTTP resource, starting at offset and ending at offset+count. A zero-value HTTPRange indicates the entire resource. An HTTPRange which has an offset and zero value count indicates from the offset to the resource's end.
type NTFSFileAttributes ¶
type NTFSFileAttributes struct {
ReadOnly, Hidden, System, Directory, Archive, None, Temporary, Offline, NotContentIndexed, NoScrubData bool
}
NTFSFileAttributes for Files and Directories. The subset of attributes is listed at: https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties#file-system-attributes.
func ParseNTFSFileAttributes ¶ added in v1.0.0
func ParseNTFSFileAttributes(attributes *string) (*NTFSFileAttributes, error)
ParseNTFSFileAttributes parses the file attributes from *string to *NTFSFileAttributes. It returns an error for any unknown file attribute.
func (*NTFSFileAttributes) String ¶
func (f *NTFSFileAttributes) String() string
String returns a string representation of NTFSFileAttributes.
type Permissions ¶
type Permissions struct { // If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission // size is <= 8KB, else x-ms-file-permission-key header shall be used. Default // value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission // or x-ms-file-permission-key should be specified. Permission *string // Key of the permission to be set for the directory/file. // Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. PermissionKey *string }
Permissions contains the optional parameters for the permissions on the file.
func (*Permissions) Format
deprecated
func (p *Permissions) Format(defaultFilePermissionStr string) (*string, *string)
Deprecated: Internal implementation; use FormatPermissions instead. Format returns file permission string and permission key.
type SMBProperties ¶
type SMBProperties struct { // NTFSFileAttributes for Files and Directories. Default value is 'None' for file and // 'Directory' for directory. ‘None’ can also be specified as default. Attributes *NTFSFileAttributes // The Coordinated Universal Time (UTC) creation time for the file/directory. Default value is 'now'. CreationTime *time.Time // The Coordinated Universal Time (UTC) last write time for the file/directory. Default value is 'now'. LastWriteTime *time.Time // The Coordinated Universal Time (UTC) change time for the file/directory. Default value is 'now'. ChangeTime *time.Time }
SMBProperties contains the optional parameters regarding the SMB/NTFS properties for a file.
func (*SMBProperties) Format
deprecated
func (sp *SMBProperties) Format(isDir bool, defaultFileAttributes string, defaultCurrentTimeString string) (fileAttributes string, creationTime string, lastWriteTime string)
Deprecated: Internal implementation; use FormatSMBProperties instead. Format returns file attributes, creation time and last write time.
type SharedKeyCredPolicy ¶
type SharedKeyCredPolicy struct {
// contains filtered or unexported fields
}
func NewSharedKeyCredPolicy ¶
func NewSharedKeyCredPolicy(cred *SharedKeyCredential) *SharedKeyCredPolicy
type SharedKeyCredential ¶
type SharedKeyCredential struct {
// contains filtered or unexported fields
}
SharedKeyCredential contains an account's name and its primary or secondary key.
func NewSharedKeyCredential ¶
func NewSharedKeyCredential(accountName string, accountKey string) (*SharedKeyCredential, error)
NewSharedKeyCredential creates an immutable SharedKeyCredential containing the storage account's name and either its primary or secondary key.
func (*SharedKeyCredential) AccountName ¶
func (c *SharedKeyCredential) AccountName() string
AccountName returns the Storage account's name.
func (*SharedKeyCredential) SetAccountKey ¶
func (c *SharedKeyCredential) SetAccountKey(accountKey string) error
SetAccountKey replaces the existing account key with the specified account key.
type SourceCopyFileAttributes ¶
type SourceCopyFileAttributes struct { }
SourceCopyFileAttributes specifies to copy file attributes from a source file(source) to a target file
func (SourceCopyFileAttributes) FormatAttributes ¶
func (s SourceCopyFileAttributes) FormatAttributes() *string
type SourceCopyFileChangeTime ¶ added in v1.1.0
type SourceCopyFileChangeTime struct { }
SourceCopyFileChangeTime specifies to copy file change time from a source file(source) to a target file.
func (SourceCopyFileChangeTime) FormatChangeTime ¶ added in v1.1.0
func (s SourceCopyFileChangeTime) FormatChangeTime() *string
type SourceCopyFileCreationTime ¶
type SourceCopyFileCreationTime struct { }
SourceCopyFileCreationTime specifies to copy file creation time from a source file(source) to a target file.
func (SourceCopyFileCreationTime) FormatCreationTime ¶
func (s SourceCopyFileCreationTime) FormatCreationTime() *string
type SourceCopyFileLastWriteTime ¶
type SourceCopyFileLastWriteTime struct { }
SourceCopyFileLastWriteTime specifies to copy file last write time from a source file(source) to a target file.
func (SourceCopyFileLastWriteTime) FormatLastWriteTime ¶
func (s SourceCopyFileLastWriteTime) FormatLastWriteTime() *string
type TransferValidationType ¶
type TransferValidationType interface { Apply(io.ReadSeekCloser, generated.TransactionalContentSetter) (io.ReadSeekCloser, error) // contains filtered or unexported methods }
TransferValidationType abstracts the various mechanisms used to verify a transfer.
type TransferValidationTypeMD5 ¶
type TransferValidationTypeMD5 []byte
TransferValidationTypeMD5 is a TransferValidationType used to provide a precomputed MD5.
func (TransferValidationTypeMD5) Apply ¶
func (c TransferValidationTypeMD5) Apply(rsc io.ReadSeekCloser, cfg generated.TransactionalContentSetter) (io.ReadSeekCloser, error)