directory

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 16 Imported by: 8

Documentation

Overview

Example (Client_NewClient)
package main

import (
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/service"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
	if !ok {
		panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
	}
	accountKey, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_KEY")
	if !ok {
		panic("AZURE_STORAGE_ACCOUNT_KEY could not be found")
	}

	serviceURL := fmt.Sprintf("https://%s.file.core.windows.net/", accountName)

	cred, err := service.NewSharedKeyCredential(accountName, accountKey)
	handleError(err)

	client, err := service.NewClientWithSharedKeyCredential(serviceURL, cred, nil)
	handleError(err)

	shareClient := client.NewShareClient("testShare")

	dirClient := shareClient.NewDirectoryClient("testDir")
	fmt.Println(dirClient.URL())

}
Output:

Example (DirectoryClient_Create)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	// Your connection string can be obtained from the Azure Portal.
	connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING")
	if !ok {
		log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found")
	}
	shareName := "testShare"
	dirName := "testDirectory"
	dirClient, err := directory.NewClientFromConnectionString(connectionString, shareName, dirName, nil)
	handleError(err)
	_, err = dirClient.Create(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory created")

	_, err = dirClient.Delete(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory deleted")
}
Output:

Example (DirectoryClient_ListFilesAndDirectoriesSegment)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING")
	if !ok {
		log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found")
	}
	shareName := "testShare"
	parentDirName := "testParentDirectory"
	childDirName := "testChildDirectory"
	parentDirClient, err := directory.NewClientFromConnectionString(connectionString, shareName, parentDirName, nil)
	handleError(err)
	_, err = parentDirClient.Create(context.Background(), nil)
	handleError(err)
	fmt.Println("Parent directory created")

	childDirClient := parentDirClient.NewSubdirectoryClient(childDirName)
	_, err = childDirClient.Create(context.Background(), nil)
	handleError(err)
	fmt.Println("Child directory created")

	pager := parentDirClient.NewListFilesAndDirectoriesPager(nil)
	for pager.More() {
		resp, err := pager.NextPage(context.Background())
		handleError(err) // if err is not nil, break the loop.
		for _, _dir := range resp.Segment.Directories {
			fmt.Printf("%v", _dir)
		}
	}

	_, err = childDirClient.Delete(context.Background(), nil)
	handleError(err)
	fmt.Println("Child directory deleted")

	_, err = parentDirClient.Delete(context.Background(), nil)
	handleError(err)
	fmt.Println("Parent directory deleted")
}
Output:

Example (DirectoryClient_OAuth)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
	if !ok {
		panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
	}

	cred, err := azidentity.NewDefaultAzureCredential(nil)
	handleError(err)

	shareName := "testShare"
	dirName := "testDirectory"
	dirURL := "https://" + accountName + ".file.core.windows.net/" + shareName + "/" + dirName

	dirClient, err := directory.NewClient(dirURL, cred, &directory.ClientOptions{FileRequestIntent: to.Ptr(directory.ShareTokenIntentBackup)})
	handleError(err)

	_, err = dirClient.Create(context.TODO(), nil)
	handleError(err)
	fmt.Println("Directory created")

	_, err = dirClient.GetProperties(context.TODO(), nil)
	handleError(err)
	fmt.Println("Directory properties retrieved")

	_, err = dirClient.Delete(context.TODO(), nil)
	handleError(err)
	fmt.Println("Directory deleted")
}
Output:

Example (DirectoryClient_Rename)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
	if !ok {
		panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
	}

	cred, err := azidentity.NewDefaultAzureCredential(nil)
	handleError(err)

	shareName := "testShare"
	srcDirName := "testDirectory"
	destDirName := "newDirectory"
	srcDirURL := "https://" + accountName + ".file.core.windows.net/" + shareName + "/" + srcDirName

	srcDirClient, err := directory.NewClient(srcDirURL, cred, &directory.ClientOptions{FileRequestIntent: to.Ptr(directory.ShareTokenIntentBackup)})
	handleError(err)

	_, err = srcDirClient.Rename(context.TODO(), destDirName, nil)
	handleError(err)
	fmt.Println("Directory renamed")
}
Output:

Example (DirectoryClient_SetMetadata)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	// Your connection string can be obtained from the Azure Portal.
	connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING")
	if !ok {
		log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found")
	}
	shareName := "testShare"
	dirName := "testDirectory"
	dirClient, err := directory.NewClientFromConnectionString(connectionString, shareName, dirName, nil)
	handleError(err)
	_, err = dirClient.Create(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory created")

	md := map[string]*string{
		"Foo": to.Ptr("FooValuE"),
		"Bar": to.Ptr("bArvaLue"),
	}

	_, err = dirClient.SetMetadata(context.Background(), &directory.SetMetadataOptions{
		Metadata: md,
	})
	handleError(err)
	fmt.Println("Directory metadata set")

	_, err = dirClient.Delete(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory deleted")
}
Output:

Example (DirectoryClient_SetProperties)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/file"
	"log"
	"os"
	"time"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	// Your connection string can be obtained from the Azure Portal.
	connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING")
	if !ok {
		log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found")
	}
	shareName := "testShare"
	dirName := "testDirectory"
	dirClient, err := directory.NewClientFromConnectionString(connectionString, shareName, dirName, nil)
	handleError(err)
	_, err = dirClient.Create(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory created")

	creationTime := time.Now().Add(5 * time.Minute).Round(time.Microsecond)
	lastWriteTime := time.Now().Add(10 * time.Minute).Round(time.Millisecond)
	testSDDL := `O:S-1-5-32-548G:S-1-5-21-397955417-626881126-188441444-512D:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)`

	// Set the custom permissions
	_, err = dirClient.SetProperties(context.Background(), &directory.SetPropertiesOptions{
		FileSMBProperties: &file.SMBProperties{
			Attributes: &file.NTFSFileAttributes{
				ReadOnly: true,
				System:   true,
			},
			CreationTime:  &creationTime,
			LastWriteTime: &lastWriteTime,
		},
		FilePermissions: &file.Permissions{
			Permission: &testSDDL,
		},
	})
	handleError(err)
	fmt.Println("Directory properties set")

	_, err = dirClient.GetProperties(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory properties retrieved")

	_, err = dirClient.Delete(context.Background(), nil)
	handleError(err)
	fmt.Println("Directory deleted")
}
Output:

Example (DirectoryClient_TrailingDot)
package main

import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
	if !ok {
		panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
	}

	cred, err := azidentity.NewDefaultAzureCredential(nil)
	handleError(err)

	shareName := "testShare"
	dirName := "testDirectory.." // directory name with trailing dot
	dirURL := "https://" + accountName + ".file.core.windows.net/" + shareName + "/" + dirName

	dirClient, err := directory.NewClient(dirURL, cred, &directory.ClientOptions{
		FileRequestIntent: to.Ptr(directory.ShareTokenIntentBackup),
		AllowTrailingDot:  to.Ptr(true),
	})
	handleError(err)

	fmt.Println(dirClient.URL())

	_, err = dirClient.Create(context.TODO(), nil)
	handleError(err)
	fmt.Println("Directory created")

	_, err = dirClient.GetProperties(context.TODO(), nil)
	handleError(err)
	fmt.Println("Directory properties retrieved")

	_, err = dirClient.Delete(context.TODO(), nil)
	handleError(err)
	fmt.Println("Directory deleted")
}
Output:

Example (Directory_NewClientFromConnectionString)
package main

import (
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/directory"
	"log"
	"os"
)

func handleError(err error) {
	if err != nil {
		log.Fatal(err.Error())
	}
}

func main() {
	// Your connection string can be obtained from the Azure Portal.
	connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING")
	if !ok {
		log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found")
	}
	shareName := "testShare"
	dirName := "testDirectory"
	dirClient, err := directory.NewClientFromConnectionString(connectionString, shareName, dirName, nil)
	handleError(err)
	fmt.Println(dirClient.URL())
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

Client represents a URL to the Azure Storage directory allowing you to manipulate its directories and files.

func NewClient added in v1.1.0

func NewClient(directoryURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error)

NewClient creates an instance of Client with the specified values.

  • directoryURL - the URL of the directory e.g. https://<account>.file.core.windows.net/share/directory
  • cred - an Azure AD credential, typically obtained via the azidentity module
  • options - client options; pass nil to accept the default values

Note that ClientOptions.FileRequestIntent is currently required for token authentication.

func NewClientFromConnectionString

func NewClientFromConnectionString(connectionString string, shareName string, directoryPath 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
  • directoryPath - the path of the directory within the share
  • options - client options; pass nil to accept the default values

func NewClientWithNoCredential

func NewClientWithNoCredential(directoryURL string, options *ClientOptions) (*Client, error)

NewClientWithNoCredential creates an instance of Client with the specified values. This is used to anonymously access a directory or with a shared access signature (SAS) token.

  • directoryURL - the URL of the directory e.g. https://<account>.file.core.windows.net/share/directory?<sas token>
  • options - client options; pass nil to accept the default values

func NewClientWithSharedKeyCredential

func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error)

NewClientWithSharedKeyCredential creates an instance of Client with the specified values.

  • directoryURL - the URL of the directory e.g. https://<account>.file.core.windows.net/share/directory
  • cred - a SharedKeyCredential created with the matching directory's storage account and access key
  • options - client options; pass nil to accept the default values

func (*Client) Create

func (d *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)

Create operation creates a new directory under the specified share or parent directory. file.ParseNTFSFileAttributes method can be used to convert the file attributes returned in response to NTFSFileAttributes. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory.

func (*Client) Delete

func (d *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)

Delete operation removes the specified empty directory. Note that the directory must be empty before it can be deleted. Deleting directories that aren't empty returns error 409 (Directory Not Empty). For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory.

func (*Client) ForceCloseHandles

func (d *Client) ForceCloseHandles(ctx context.Context, handleID string, options *ForceCloseHandlesOptions) (ForceCloseHandlesResponse, error)

ForceCloseHandles operation closes a handle or handles opened on a directory.

  • handleID - Specifies the handle ID to be closed. Use an asterisk (*) as a wildcard string to specify all handles.

For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles.

func (*Client) GetProperties

func (d *Client) GetProperties(ctx context.Context, options *GetPropertiesOptions) (GetPropertiesResponse, error)

GetProperties operation returns all system properties for the specified directory, and it can also be used to check the existence of a directory. file.ParseNTFSFileAttributes method can be used to convert the file attributes returned in response to NTFSFileAttributes. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-directory-properties.

func (*Client) ListHandles

func (d *Client) ListHandles(ctx context.Context, options *ListHandlesOptions) (ListHandlesResponse, error)

ListHandles operation returns a list of open handles on a directory. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/list-handles.

func (*Client) NewFileClient

func (d *Client) NewFileClient(fileName string) *file.Client

NewFileClient creates a new file.Client object by concatenating fileName to the end of this Client's URL. The new file.Client uses the same request policy pipeline as the Client.

func (*Client) NewListFilesAndDirectoriesPager

func (d *Client) NewListFilesAndDirectoriesPager(options *ListFilesAndDirectoriesOptions) *runtime.Pager[ListFilesAndDirectoriesResponse]

NewListFilesAndDirectoriesPager operation returns a pager for the files and directories starting from the specified Marker. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files.

func (*Client) NewSubdirectoryClient

func (d *Client) NewSubdirectoryClient(subDirectoryName string) *Client

NewSubdirectoryClient creates a new Client object by concatenating subDirectoryName to the end of this Client's URL. The new subdirectory Client uses the same request policy pipeline as the parent directory Client.

func (*Client) Rename added in v1.1.0

func (d *Client) Rename(ctx context.Context, destinationPath string, options *RenameOptions) (RenameResponse, error)

Rename operation renames a directory, and can optionally set system properties for the directory.

  • destinationPath: the destination path to rename the directory to.

For more information, see https://learn.microsoft.com/rest/api/storageservices/rename-directory.

func (*Client) SetMetadata

func (d *Client) SetMetadata(ctx context.Context, options *SetMetadataOptions) (SetMetadataResponse, error)

SetMetadata operation sets user-defined metadata for the specified directory. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata.

func (*Client) SetProperties

func (d *Client) SetProperties(ctx context.Context, options *SetPropertiesOptions) (SetPropertiesResponse, error)

SetProperties operation sets system properties for the specified directory. file.ParseNTFSFileAttributes method can be used to convert the file attributes returned in response to NTFSFileAttributes. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-directory-properties.

func (*Client) URL

func (d *Client) URL() string

URL returns the URL endpoint used by the Client object.

type ClientOptions

type ClientOptions base.ClientOptions

ClientOptions contains the optional parameters when creating a Client.

type CreateOptions

type CreateOptions struct {
	// The default value is 'Directory' for Attributes and 'now' for CreationTime and LastWriteTime fields in file.SMBProperties.
	FileSMBProperties *file.SMBProperties
	// The default value is 'inherit' for Permission field in file.Permissions.
	FilePermissions *file.Permissions
	// A name-value pair to associate with a file storage object.
	Metadata map[string]*string
}

CreateOptions contains the optional parameters for the Client.Create method.

type CreateResponse

CreateResponse contains the response from method Client.Create.

type DeleteOptions

type DeleteOptions struct {
}

DeleteOptions contains the optional parameters for the Client.Delete method.

type DeleteResponse

DeleteResponse contains the response from method Client.Delete.

type DestinationLeaseAccessConditions added in v1.1.0

type DestinationLeaseAccessConditions = generated.DestinationLeaseAccessConditions

DestinationLeaseAccessConditions contains optional parameters to access the destination directory.

type Directory

type Directory = generated.Directory

Directory - A listed directory item.

type File

type File = generated.File

File - A listed file item.

type FileProperty

type FileProperty = generated.FileProperty

FileProperty - File properties.

type FilesAndDirectoriesListSegment

type FilesAndDirectoriesListSegment = generated.FilesAndDirectoriesListSegment

FilesAndDirectoriesListSegment - Abstract for entries that can be listed from directory.

type ForceCloseHandlesOptions

type ForceCloseHandlesOptions struct {
	// A string value that identifies the portion of the list to be returned with the next list operation. The operation returns
	// a marker value within the response body if the list returned was not complete.
	// The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque
	// to the client.
	Marker *string
	// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files.
	Recursive *bool
	// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query.
	ShareSnapshot *string
}

ForceCloseHandlesOptions contains the optional parameters for the Client.ForceCloseHandles method.

type ForceCloseHandlesResponse

type ForceCloseHandlesResponse = generated.DirectoryClientForceCloseHandlesResponse

ForceCloseHandlesResponse contains the response from method Client.ForceCloseHandles.

type GetPropertiesOptions

type GetPropertiesOptions struct {
	// ShareSnapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query for the directory properties.
	ShareSnapshot *string
}

GetPropertiesOptions contains the optional parameters for the Client.GetProperties method.

type GetPropertiesResponse

type GetPropertiesResponse = generated.DirectoryClientGetPropertiesResponse

GetPropertiesResponse contains the response from method Client.GetProperties.

type Handle

type Handle = generated.Handle

Handle - A listed Azure Storage handle item.

type ListFilesAndDirectoriesOptions

type ListFilesAndDirectoriesOptions struct {
	// Include this parameter to specify one or more datasets to include in the response.
	Include ListFilesInclude
	// Include extended information.
	IncludeExtendedInfo *bool
	// A string value that identifies the portion of the list to be returned with the next list operation. The operation returns
	// a marker value within the response body if the list returned was not complete.
	// The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque
	// to the client.
	Marker *string
	// Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater
	// than 5,000, the server will return up to 5,000 items.
	MaxResults *int32
	// Filters the results to return only entries whose name begins with the specified prefix.
	Prefix *string
	// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query for the list of files and directories.
	ShareSnapshot *string
}

ListFilesAndDirectoriesOptions contains the optional parameters for the Client.NewListFilesAndDirectoriesPager method.

type ListFilesAndDirectoriesResponse

type ListFilesAndDirectoriesResponse = generated.DirectoryClientListFilesAndDirectoriesSegmentResponse

ListFilesAndDirectoriesResponse contains the response from method Client.NewListFilesAndDirectoriesPager.

type ListFilesAndDirectoriesSegmentResponse

type ListFilesAndDirectoriesSegmentResponse = generated.ListFilesAndDirectoriesSegmentResponse

ListFilesAndDirectoriesSegmentResponse - An enumeration of directories and files.

type ListFilesInclude

type ListFilesInclude struct {
	Timestamps, ETag, Attributes, PermissionKey bool
}

ListFilesInclude specifies one or more datasets to include in the response.

type ListFilesIncludeType

type ListFilesIncludeType = generated.ListFilesIncludeType

ListFilesIncludeType defines values for ListFilesIncludeType

func PossibleListFilesIncludeTypeValues

func PossibleListFilesIncludeTypeValues() []ListFilesIncludeType

PossibleListFilesIncludeTypeValues returns the possible values for the ListFilesIncludeType const type.

type ListHandlesOptions

type ListHandlesOptions struct {
	// A string value that identifies the portion of the list to be returned with the next list operation. The operation returns
	// a marker value within the response body if the list returned was not complete.
	// The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque
	// to the client.
	Marker *string
	// Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater
	// than 5,000, the server will return up to 5,000 items.
	MaxResults *int32
	// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files.
	Recursive *bool
	// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query.
	ShareSnapshot *string
}

ListHandlesOptions contains the optional parameters for the Client.ListHandles method.

type ListHandlesResponse

type ListHandlesResponse = generated.DirectoryClientListHandlesResponse

ListHandlesResponse contains the response from method Client.ListHandles.

type ListHandlesSegmentResponse

type ListHandlesSegmentResponse = generated.ListHandlesResponse

ListHandlesSegmentResponse - An enumeration of handles.

type RenameOptions added in v1.1.0

type RenameOptions struct {
	// FileSMBProperties contains the optional parameters regarding the SMB/NTFS properties for a file.
	FileSMBProperties *file.SMBProperties
	// FilePermissions contains the optional parameters for the permissions on the file.
	FilePermissions *file.Permissions
	// IgnoreReadOnly specifies whether the ReadOnly attribute on a pre-existing destination file should be respected.
	// If true, rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause rename to fail.
	IgnoreReadOnly *bool
	// A name-value pair to associate with a file storage object.
	Metadata map[string]*string
	// ReplaceIfExists specifies that if the destination file already exists, whether this request will overwrite the file or not.
	// If true, rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist,
	// the request will not overwrite the destination file.
	// If provided and the destination file does not exist, rename will succeed.
	ReplaceIfExists *bool
	// DestinationLeaseAccessConditions contains optional parameters to access the destination directory.
	DestinationLeaseAccessConditions *DestinationLeaseAccessConditions
}

RenameOptions contains the optional parameters for the Client.Rename method.

type RenameResponse added in v1.1.0

type RenameResponse struct {
	generated.DirectoryClientRenameResponse
}

RenameResponse contains the response from method Client.Rename.

type SetMetadataOptions

type SetMetadataOptions struct {
	// A name-value pair to associate with a file storage object.
	Metadata map[string]*string
}

SetMetadataOptions contains the optional parameters for the Client.SetMetadata method.

type SetMetadataResponse

type SetMetadataResponse = generated.DirectoryClientSetMetadataResponse

SetMetadataResponse contains the response from method Client.SetMetadata.

type SetPropertiesOptions

type SetPropertiesOptions struct {
	// The default value is 'preserve' for Attributes, CreationTime and LastWriteTime fields in file.SMBProperties.
	FileSMBProperties *file.SMBProperties
	// The default value is 'preserve' for Permission field in file.Permissions.
	FilePermissions *file.Permissions
}

SetPropertiesOptions contains the optional parameters for the Client.SetProperties method.

type SetPropertiesResponse

type SetPropertiesResponse = generated.DirectoryClientSetPropertiesResponse

SetPropertiesResponse contains the response from method Client.SetProperties.

type ShareTokenIntent added in v1.1.0

type ShareTokenIntent = generated.ShareTokenIntent

ShareTokenIntent is required if authorization header specifies an OAuth token.

const (
	ShareTokenIntentBackup ShareTokenIntent = generated.ShareTokenIntentBackup
)

func PossibleShareTokenIntentValues added in v1.1.0

func PossibleShareTokenIntentValues() []ShareTokenIntent

PossibleShareTokenIntentValues returns the possible values for the ShareTokenIntent const type.

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.

Jump to

Keyboard shortcuts

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