Documentation ¶
Index ¶
- Constants
- Variables
- func AfterTest(t *testing.T, suite string, test string)
- func BeforeTest(t *testing.T, suite string, test string)
- func CreateNewDir(ctx context.Context, _require *require.Assertions, dirName string, ...) *directory.Client
- func CreateNewFile(ctx context.Context, _require *require.Assertions, fileName string, ...) *file.Client
- func CreateNewFileSystem(ctx context.Context, _require *require.Assertions, filesystemName string, ...) *filesystem.Client
- func DeleteDir(ctx context.Context, _require *require.Assertions, dirClient *directory.Client)
- func DeleteFile(ctx context.Context, _require *require.Assertions, fileClient *file.Client)
- func DeleteFileSystem(ctx context.Context, _require *require.Assertions, ...)
- func GenerateData(sizeInBytes int) (io.ReadSeekCloser, []byte)
- func GenerateDirName(testName string) string
- func GenerateEntityName(testName string) string
- func GenerateFileName(testName string) string
- func GenerateFileSystemName(testName string) string
- func GenerateSubDirName(testName string) string
- func GetDirClient(fsName, dirName string, t *testing.T, accountType TestAccountType, ...) (*directory.Client, error)
- func GetFileClient(fsName, fName string, t *testing.T, accountType TestAccountType, ...) (*file.Client, error)
- func GetFileSystemClient(fsName string, t *testing.T, accountType TestAccountType, ...) (*filesystem.Client, error)
- func GetGenericAccountInfo(accountType TestAccountType) (string, string)
- func GetGenericConnectionString(accountType TestAccountType) (*string, error)
- func GetGenericSharedKeyCredential(accountType TestAccountType) (*azdatalake.SharedKeyCredential, error)
- func GetGenericTokenCredential() (azcore.TokenCredential, error)
- func GetRelativeTimeFromAnchor(anchorTime *time.Time, amount time.Duration) time.Time
- func GetRequiredEnv(name string) (string, error)
- func GetServiceClient(t *testing.T, accountType TestAccountType, options *service.ClientOptions) (*service.Client, error)
- func GetServiceClientFromConnectionString(t *testing.T, accountType TestAccountType, options *service.ClientOptions) (*service.Client, error)
- func GetServiceClientNoCredential(t *testing.T, sasUrl string, options *service.ClientOptions) (*service.Client, error)
- func ServiceGetFileSystemClient(filesystemName string, s *service.Client) *filesystem.Client
- func SetClientOptions(t *testing.T, opts *azcore.ClientOptions)
- func SetupSuite(suite *suite.Suite) *recording.TestProxyInstance
- func TearDownSuite(suite *suite.Suite, proxy *recording.TestProxyInstance)
- func ValidateErrorCode(_require *require.Assertions, err error, code datalakeerror.StorageErrorCode)
- type TestAccountType
Constants ¶
View Source
const ( DefaultEndpointSuffix = "core.windows.net/" DefaultBlobEndpointSuffix = "blob.core.windows.net/" AccountNameEnvVar = "AZURE_STORAGE_ACCOUNT_NAME" AccountKeyEnvVar = "AZURE_STORAGE_ACCOUNT_KEY" DefaultEndpointSuffixEnvVar = "AZURE_STORAGE_ENDPOINT_SUFFIX" DataLakeEncryptionScopeEnvVar = "DATALAKE_AZURE_STORAGE_ENCRYPTION_SCOPE" SubscriptionID = "SUBSCRIPTION_ID" ResourceGroupName = "RESOURCE_GROUP_NAME" )
View Source
const ( FakeStorageAccount = "fakestorage" FakeBlobStorageURL = "https://fakestorage.blob.core.windows.net" FakeDFSStorageURL = "https://fakestorage.dfs.core.windows.net" FakeToken = "faketoken" )
View Source
const ( RecordingDirectory = "sdk/storage/azdatalake/testdata" FileSystemPrefix = "gofs" FilePrefix = "gotestfile" DirPrefix = "gotestdir" SubDirPrefix = "gotestsubdir" DefaultData = "Godatalakedata" InvalidHeaderErrorSubstring = "invalid header field" // error thrown by the http client )
Variables ¶
View Source
var ( DatalakeContentType = "my_type" DatalakeContentDisposition = "my_disposition" DatalakeCacheControl = "control" DatalakeContentLanguage = "my_language" DatalakeContentEncoding = "my_encoding" )
View Source
var ( TestEncryptionContext = "test_encryption_context" TestCPKByValue = file.CPKInfo{ EncryptionKey: &testEncryptedKey, EncryptionKeySHA256: &testEncryptedHash, EncryptionAlgorithm: &testEncryptionAlgorithm, } TestEncryptionScope = "datalaketestencryptionscope" TestCPKScopeInfo = container.CPKScopeInfo{ DefaultEncryptionScope: &TestEncryptionScope, PreventEncryptionScopeOverride: to.Ptr(false), } )
View Source
var BasicHeaders = file.HTTPHeaders{ ContentType: &DatalakeContentType, ContentDisposition: &DatalakeContentDisposition, CacheControl: &DatalakeCacheControl, ContentMD5: nil, ContentLanguage: &DatalakeContentLanguage, ContentEncoding: &DatalakeContentEncoding, }
View Source
var BasicMetadata = map[string]*string{"Foo": to.Ptr("bar")}
Functions ¶
func CreateNewDir ¶
func CreateNewDir(ctx context.Context, _require *require.Assertions, dirName string, filesystemClient *filesystem.Client) *directory.Client
func CreateNewFile ¶
func CreateNewFile(ctx context.Context, _require *require.Assertions, fileName string, filesystemClient *filesystem.Client) *file.Client
func CreateNewFileSystem ¶
func CreateNewFileSystem(ctx context.Context, _require *require.Assertions, filesystemName string, serviceClient *service.Client) *filesystem.Client
func DeleteFile ¶
func DeleteFileSystem ¶
func DeleteFileSystem(ctx context.Context, _require *require.Assertions, filesystemClient *filesystem.Client)
func GenerateData ¶
func GenerateData(sizeInBytes int) (io.ReadSeekCloser, []byte)
func GenerateDirName ¶
func GenerateEntityName ¶
func GenerateFileName ¶
func GenerateFileSystemName ¶
func GenerateSubDirName ¶ added in v1.1.0
func GetDirClient ¶
func GetDirClient(fsName, dirName string, t *testing.T, accountType TestAccountType, options *directory.ClientOptions) (*directory.Client, error)
func GetFileClient ¶
func GetFileClient(fsName, fName string, t *testing.T, accountType TestAccountType, options *file.ClientOptions) (*file.Client, error)
func GetFileSystemClient ¶
func GetFileSystemClient(fsName string, t *testing.T, accountType TestAccountType, options *filesystem.ClientOptions) (*filesystem.Client, error)
func GetGenericAccountInfo ¶
func GetGenericAccountInfo(accountType TestAccountType) (string, string)
func GetGenericConnectionString ¶
func GetGenericConnectionString(accountType TestAccountType) (*string, error)
func GetGenericSharedKeyCredential ¶
func GetGenericSharedKeyCredential(accountType TestAccountType) (*azdatalake.SharedKeyCredential, error)
func GetGenericTokenCredential ¶
func GetGenericTokenCredential() (azcore.TokenCredential, error)
func GetRequiredEnv ¶
GetRequiredEnv gets an environment variable by name and returns an error if it is not found
func GetServiceClient ¶
func GetServiceClient(t *testing.T, accountType TestAccountType, options *service.ClientOptions) (*service.Client, error)
func GetServiceClientFromConnectionString ¶
func GetServiceClientFromConnectionString(t *testing.T, accountType TestAccountType, options *service.ClientOptions) (*service.Client, error)
func ServiceGetFileSystemClient ¶
func ServiceGetFileSystemClient(filesystemName string, s *service.Client) *filesystem.Client
func SetClientOptions ¶
func SetClientOptions(t *testing.T, opts *azcore.ClientOptions)
func SetupSuite ¶ added in v1.1.0
func SetupSuite(suite *suite.Suite) *recording.TestProxyInstance
func TearDownSuite ¶ added in v1.1.0
func TearDownSuite(suite *suite.Suite, proxy *recording.TestProxyInstance)
func ValidateErrorCode ¶
func ValidateErrorCode(_require *require.Assertions, err error, code datalakeerror.StorageErrorCode)
Types ¶
type TestAccountType ¶
type TestAccountType string
const ( TestAccountDefault TestAccountType = "" TestAccountSecondary TestAccountType = "SECONDARY_" TestAccountPremium TestAccountType = "PREMIUM_" TestAccountSoftDelete TestAccountType = "SOFT_DELETE_" TestAccountDatalake TestAccountType = "DATALAKE_" TestAccountImmutable TestAccountType = "IMMUTABLE_" )
Click to show internal directories.
Click to hide internal directories.