exported

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName    = "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile"
	ModuleVersion = "v1.5.2"
)
View Source
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 FormatCopyFileNFSProperties added in v1.5.1

func FormatCopyFileNFSProperties(np *CopyFileNFSProperties) (opts *generated.CopyFileSMBInfo)

FormatCopyFileNFSProperties returns creation time, last write time.

func FormatHTTPRange

func FormatHTTPRange(r HTTPRange) *string

FormatHTTPRange converts an HTTPRange to its string format.

func FormatNFSProperties added in v1.5.1

func FormatNFSProperties(np *NFSProperties, isDir bool) (creationTime *string, lastWriteTime *string)

FormatNFSProperties returns creation time, last write time.

func FormatPermissions added in v1.1.0

func FormatPermissions(p *Permissions) (*string, *string)

FormatPermissions returns file permission string and permission key.

func FormatSMBProperties added in v1.1.0

func FormatSMBProperties(sp *SMBProperties, 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 CopyFileNFSProperties added in v1.5.1

type CopyFileNFSProperties struct {
	// 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.
	// CopyFileCreationTime is an interface and its underlying implementation are:
	//   - SourceCopyFileCreationTime - specifies to copy file creation time from a source file to a target file.
	//   - DestinationCopyFileCreationTime - specifies a time value in ISO 8601 format to set as creation time on a target file.
	CreationTime CopyFileCreationTime
	// 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.
	// CopyFileLastWriteTime is an interface and its underlying implementation are:
	//   - SourceCopyFileLastWriteTime - specifies to copy file last write time from a source file to a target file.
	//   - DestinationCopyFileLastWriteTime - specifies a time value in ISO 8601 format to set as last write time on a target file.
	LastWriteTime CopyFileLastWriteTime
	// The file mode of the file or directory
	FileMode *string
	// The owner of the file or directory.
	Owner *string
	// The owning group of the file or directory.
	Group *string
	// NFS only. Applicable only when the copy source is a File. Determines the copy behavior of the mode bits of the file.
	// source: The mode on the destination file is copied from the source file.
	// override: The mode on the destination file is determined via the x-ms-mode header.
	FileModeCopyMode *generated.ModeCopyMode
	// NFS only. Determines the copy behavior of the owner user identifier (UID) and group identifier (GID) of the file.
	// source: The owner user identifier (UID) and group identifier (GID) on the destination
	// file is copied from the source file. override: The owner user identifier (UID) and group identifier (GID) on the destination
	// file is determined via the x-ms-owner and x-ms-group headers.
	FileOwnerCopyMode *generated.OwnerCopyMode
}

CopyFileNFSProperties contains the optional parameters regarding the NFS properties for a 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

type DestinationCopyFileChangeTime time.Time

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

type DestinationCopyFileCreationTime time.Time

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

type DestinationCopyFileLastWriteTime time.Time

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

type HTTPRange struct {
	Offset int64
	Count  int64
}

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 NFSProperties added in v1.5.1

type NFSProperties struct {
	// 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 file mode of the file or directory
	FileMode *string
	// The owner of the file or directory.
	Owner *string
	// The owning group of the file or directory.
	Group *string
}

NFSProperties contains the optional parameters regarding the NFS properties for a file.

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

func (*SharedKeyCredPolicy) Do

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

Jump to

Keyboard shortcuts

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