Documentation ¶
Index ¶
- Constants
- Variables
- func AtomicMorphInt32(target *int32, morpher AtomicMorpherInt32) interface{}
- func AtomicMorphInt64(target *int64, morpher AtomicMorpherInt64) interface{}
- func AtomicMorphUint32(target *uint32, morpher AtomicMorpherUint32) interface{}
- func AtomicMorphUint64(target *uint64, morpher AtomicMorpherUint64) interface{}
- func CreateBlobCredential(ctx context.Context, credInfo CredentialInfo, options CredentialOpOptions) azblob.Credential
- func CreateBlobFSCredential(ctx context.Context, credInfo CredentialInfo, options CredentialOpOptions) azbfs.Credential
- func CreateFileOfSize(destinationPath string, fileSize int64) (*os.File, error)
- func CreateParentDirectoryIfNotExist(destinationPath string) error
- func EnvVarOAuthTokenInfoExists() bool
- func GetBlocksRoundedUp(size uint64, blockSize uint64) uint16
- func IffError(test bool, trueVal, falseVal error) error
- func IffString(test bool, trueVal, falseVal string) string
- func IffUint8(test bool, trueVal, falseVal uint8) byte
- func Iffint16(test bool, trueVal, falseVal int16) int16
- func Iffint32(test bool, trueVal, falseVal int32) int32
- func Iffint64(test bool, trueVal, falseVal int64) int64
- func Iffint8(test bool, trueVal, falseVal int8) int8
- func Iffloat64(test bool, trueVal, falseVal float64) float64
- func Iffuint16(test bool, trueVal, falseVal uint16) uint16
- func Iffuint32(test bool, trueVal, falseVal uint32) uint32
- func Iffuint64(test bool, trueVal, falseVal uint64) uint64
- func IsErrorEnvVarOAuthTokenInfoNotSet(err error) bool
- func PanicIfErr(err error)
- type AtomicMorpherInt32
- type AtomicMorpherInt64
- type AtomicMorpherUint32
- type AtomicMorpherUint64
- type BlobTransferAttributes
- type BlockBlobTier
- func (BlockBlobTier) Archive() BlockBlobTier
- func (BlockBlobTier) Cold() BlockBlobTier
- func (BlockBlobTier) Cool() BlockBlobTier
- func (BlockBlobTier) Hot() BlockBlobTier
- func (bbt BlockBlobTier) MarshalJSON() ([]byte, error)
- func (BlockBlobTier) None() BlockBlobTier
- func (bbt *BlockBlobTier) Parse(s string) error
- func (bbt BlockBlobTier) String() string
- func (bbt BlockBlobTier) ToAccessTierType() azblob.AccessTierType
- func (bbt *BlockBlobTier) UnmarshalJSON(b []byte) error
- type ByteSlice
- type ByteSliceExtension
- type CancelPauseResumeResponse
- type CopyJobPartOrderRequest
- type CopyJobPartOrderResponse
- type CopyTransfer
- type CountPerSecond
- type CredCache
- type CredentialInfo
- type CredentialOpOptions
- type CredentialType
- type ExitCode
- type FileURLPartsExtension
- type FromTo
- func (FromTo) BlobBlob() FromTo
- func (FromTo) BlobFSLocal() FromTo
- func (FromTo) BlobLocal() FromTo
- func (FromTo) BlobPipe() FromTo
- func (FromTo) BlobTrash() FromTo
- func (FromTo) FileBlob() FromTo
- func (FromTo) FileLocal() FromTo
- func (FromTo) FilePipe() FromTo
- func (FromTo) FileTrash() FromTo
- func (ft *FromTo) From() Location
- func (ft *FromTo) FromAndTo(s string) (srcLocation, dstLocation Location, err error)
- func (FromTo) LocalBlob() FromTo
- func (FromTo) LocalBlobFS() FromTo
- func (FromTo) LocalFile() FromTo
- func (ft *FromTo) Parse(s string) error
- func (FromTo) PipeBlob() FromTo
- func (FromTo) PipeFile() FromTo
- func (ft FromTo) String() string
- func (ft *FromTo) To() Location
- func (FromTo) Unknown() FromTo
- type GetJobFromToRequest
- type GetJobFromToResponse
- type HTTPResponseExtension
- type ILogger
- type ILoggerCloser
- type ILoggerResetable
- type IdentityInfo
- type JobID
- type JobIDDetails
- type JobPriority
- type JobStatus
- func (j *JobStatus) AtomicLoad() JobStatus
- func (j *JobStatus) AtomicStore(newJobStatus JobStatus)
- func (JobStatus) Cancelled() JobStatus
- func (JobStatus) Cancelling() JobStatus
- func (JobStatus) Completed() JobStatus
- func (JobStatus) InProgress() JobStatus
- func (j JobStatus) MarshalJSON() ([]byte, error)
- func (j *JobStatus) Parse(s string) error
- func (JobStatus) Paused() JobStatus
- func (js JobStatus) String() string
- func (j *JobStatus) UnmarshalJSON(b []byte) error
- type LifecycleMgr
- type ListContainerResponse
- type ListJobSummaryResponse
- type ListJobTransfersRequest
- type ListJobTransfersResponse
- type ListJobsResponse
- type ListRequest
- type Location
- type LogLevel
- func (LogLevel) Debug() LogLevel
- func (LogLevel) Error() LogLevel
- func (LogLevel) Fatal() LogLevel
- func (LogLevel) Info() LogLevel
- func (LogLevel) None() LogLevel
- func (LogLevel) Panic() LogLevel
- func (ll *LogLevel) Parse(s string) error
- func (ll LogLevel) String() string
- func (ll LogLevel) ToPipelineLogLevel() pipeline.LogLevel
- func (LogLevel) Warning() LogLevel
- type MMF
- type Metadata
- type NoCopy
- type OAuthTokenInfo
- func (credInfo *OAuthTokenInfo) GetNewTokenFromMSI(ctx context.Context) (*adal.Token, error)
- func (credInfo OAuthTokenInfo) IsEmpty() bool
- func (credInfo *OAuthTokenInfo) Refresh(ctx context.Context) (*adal.Token, error)
- func (credInfo *OAuthTokenInfo) RefreshTokenWithUserCredential(ctx context.Context) (*adal.Token, error)
- func (credInfo OAuthTokenInfo) ToJSON() ([]byte, error)
- type OutputFormat
- type PageBlobTier
- func (pbt PageBlobTier) MarshalJSON() ([]byte, error)
- func (PageBlobTier) None() PageBlobTier
- func (PageBlobTier) P10() PageBlobTier
- func (PageBlobTier) P20() PageBlobTier
- func (PageBlobTier) P30() PageBlobTier
- func (PageBlobTier) P4() PageBlobTier
- func (PageBlobTier) P40() PageBlobTier
- func (PageBlobTier) P50() PageBlobTier
- func (PageBlobTier) P6() PageBlobTier
- func (pbt *PageBlobTier) Parse(s string) error
- func (pbt PageBlobTier) String() string
- func (pbt PageBlobTier) ToAccessTierType() azblob.AccessTierType
- func (pbt *PageBlobTier) UnmarshalJSON(b []byte) error
- type PartNumber
- type ResumeJobRequest
- type RpcCmd
- func (RpcCmd) CancelJob() RpcCmd
- func (RpcCmd) CopyJobPartOrder() RpcCmd
- func (RpcCmd) GetJobFromTo() RpcCmd
- func (RpcCmd) ListJobSummary() RpcCmd
- func (RpcCmd) ListJobTransfers() RpcCmd
- func (RpcCmd) ListJobs() RpcCmd
- func (RpcCmd) None() RpcCmd
- func (c *RpcCmd) Parse(s string) error
- func (c RpcCmd) Pattern() string
- func (RpcCmd) PauseJob() RpcCmd
- func (RpcCmd) ResumeJob() RpcCmd
- func (c RpcCmd) String() string
- type Status
- type SyncJobPartOrderRequest
- type TestOAuthInjection
- type TransferDetail
- type TransferStatus
- func (TransferStatus) All() TransferStatus
- func (ts *TransferStatus) AtomicLoad() TransferStatus
- func (ts *TransferStatus) AtomicStore(newTransferStatus TransferStatus)
- func (TransferStatus) BlobAlreadyExistsFailure() TransferStatus
- func (TransferStatus) BlobTierFailure() TransferStatus
- func (ts TransferStatus) DidFail() bool
- func (TransferStatus) Failed() TransferStatus
- func (TransferStatus) FileAlreadyExistsFailure() TransferStatus
- func (ts TransferStatus) MarshalJSON() ([]byte, error)
- func (TransferStatus) NotStarted() TransferStatus
- func (ts *TransferStatus) Parse(s string) error
- func (ts TransferStatus) ShouldTransfer() bool
- func (TransferStatus) Started() TransferStatus
- func (ts TransferStatus) String() string
- func (TransferStatus) Success() TransferStatus
- func (ts *TransferStatus) UnmarshalJSON(b []byte) error
- type URLExtension
- type URLStringExtension
- type UUID
- type UserOAuthTokenManager
- func (uotm *UserOAuthTokenManager) GetCachedTokenInfo(ctx context.Context) (*OAuthTokenInfo, error)
- func (uotm *UserOAuthTokenManager) GetTokenInfo(ctx context.Context) (*OAuthTokenInfo, error)
- func (uotm *UserOAuthTokenManager) GetTokenInfoFromEnvVar(ctx context.Context) (*OAuthTokenInfo, error)
- func (uotm *UserOAuthTokenManager) HasCachedToken() (bool, error)
- func (uotm *UserOAuthTokenManager) MSILogin(ctx context.Context, identityInfo IdentityInfo, persist bool) (*OAuthTokenInfo, error)
- func (uotm *UserOAuthTokenManager) RemoveCachedToken() error
- func (uotm *UserOAuthTokenManager) UserLogin(tenantID, activeDirectoryEndpoint string, persist bool) (*OAuthTokenInfo, error)
- type Version
- type WorkController
Constants ¶
const ( AZCOPY_PATH_SEPARATOR_STRING = "/" AZCOPY_PATH_SEPARATOR_CHAR = '/' OS_PATH_SEPARATOR = string(os.PathSeparator) )
const ( DefaultBlockBlobBlockSize = 8 * 1024 * 1024 MaxBlockBlobBlockSize = 100 * 1024 * 1024 DefaultPageBlobChunkSize = 4 * 1024 * 1024 DefaultAzureFileChunkSize = 4 * 1024 * 1024 MaxNumberOfBlocksPerBlob = 50000 )
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ApplicationID = "579a7132-0e58-4d80-b1e1-7a1e2d337859"
ApplicationID represents 1st party ApplicationID for AzCopy. const ApplicationID = "a45c21f4-7066-40b4-97d8-14f4313c3caa" // 3rd party test ApplicationID for AzCopy.
const AzcopyVersion = "10.0.2-Preview"
const DefaultActiveDirectoryEndpoint = "https://login.microsoftonline.com"
const DefaultTenantID = "microsoft.com"
const EnvVarOAuthTokenInfo = "AZCOPY_OAUTH_TOKEN_INFO"
EnvVarOAuthTokenInfo passes oauth token info into AzCopy through environment variable. Note: this is only used for testing, and not encouraged to be used in production environments.
const ErrorCodeEnvVarOAuthTokenInfoNotSet = "environment variable AZCOPY_OAUTH_TOKEN_INFO is not set"
ErrorCodeEnvVarOAuthTokenInfoNotSet defines error code when environment variable AZCOPY_OAUTH_TOKEN_INFO is not set.
const IMDSAPIVersion = "2018-02-01"
const MSIEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
const Resource = "https://storage.azure.com"
Resource used in azure storage OAuth authentication
const UserAgent = "AzCopy/v" + AzcopyVersion
Variables ¶
var DefaultTokenExpiryWithinThreshold = time.Minute * 10
var EBlockBlobTier = BlockBlobTier(0)
var ECredentialType = CredentialType(0)
var EExitCode = ExitCode(0)
var EFromTo = FromTo(0)
var EJobPriority = JobPriority(0)
var EJobStatus = JobStatus(0)
var ELocation = Location(0)
var ELogLevel = LogLevel(pipeline.LogNone)
var EOutputFormat = OutputFormat(0)
var EPageBlobTier = PageBlobTier(0)
var ERpcCmd = RpcCmd("")
var ETransferStatus = TransferStatus(0)
var GlobalTestOAuthInjection = TestOAuthInjection{ DoTokenRefreshInjection: false, TokenRefreshDuration: time.Second * 10, }
GlobalTestOAuthInjection is the global setting for OAuth testing injection control
Functions ¶
func AtomicMorphInt32 ¶
func AtomicMorphInt32(target *int32, morpher AtomicMorpherInt32) interface{}
AtomicMorph atomically morphs target in to new value (and result) as indicated by the AtomicMorpher callback function.
func AtomicMorphInt64 ¶
func AtomicMorphInt64(target *int64, morpher AtomicMorpherInt64) interface{}
AtomicMorph atomically morphs target in to new value (and result) as indicated bythe AtomicMorpher callback function.
func AtomicMorphUint32 ¶
func AtomicMorphUint32(target *uint32, morpher AtomicMorpherUint32) interface{}
AtomicMorph atomically morphs target in to new value (and result) as indicated bythe AtomicMorpher callback function.
func AtomicMorphUint64 ¶
func AtomicMorphUint64(target *uint64, morpher AtomicMorpherUint64) interface{}
AtomicMorph atomically morphs target in to new value (and result) as indicated bythe AtomicMorpher callback function.
func CreateBlobCredential ¶
func CreateBlobCredential(ctx context.Context, credInfo CredentialInfo, options CredentialOpOptions) azblob.Credential
CreateBlobCredential creates Blob credential according to credential info.
func CreateBlobFSCredential ¶
func CreateBlobFSCredential(ctx context.Context, credInfo CredentialInfo, options CredentialOpOptions) azbfs.Credential
CreateBlobFSCredential creates BlobFS credential according to credential info.
func CreateFileOfSize ¶
create a file, given its path and length
func EnvVarOAuthTokenInfoExists ¶
func EnvVarOAuthTokenInfoExists() bool
EnvVarOAuthTokenInfoExists verifies if environment variable for OAuthTokenInfo is specified. The method returns true if the environment variable is set. Note: This is useful for only checking whether the env var exists, please use GetTokenInfoFromEnvVar directly in the case getting token info is necessary.
func GetBlocksRoundedUp ¶
GetBlocksRoundedUp returns the number of blocks given sie, rounded up
func IsErrorEnvVarOAuthTokenInfoNotSet ¶
IsErrorEnvVarOAuthTokenInfoNotSet verifies if an error indicates environment variable AZCOPY_OAUTH_TOKEN_INFO is not set.
func PanicIfErr ¶
func PanicIfErr(err error)
captures the common logic of exiting if there's an expected error
Types ¶
type AtomicMorpherInt32 ¶
AtomicMorpherInt32 identifies a method passed to and invoked by the AtomicMorphInt32 function. The AtomicMorpher callback is passed a startValue and based on this value it returns what the new value should be and the result that AtomicMorph should return to its caller.
type AtomicMorpherInt64 ¶
AtomicMorpherUint64 identifies a method passed to and invoked by the AtomicMorphUint64 function. The AtomicMorpher callback is passed a startValue and based on this value it returns what the new value should be and the result that AtomicMorph should return to its caller.
type AtomicMorpherUint32 ¶
AtomicMorpherUint32 identifies a method passed to and invoked by the AtomicMorph function. The AtomicMorpher callback is passed a startValue and based on this value it returns what the new value should be and the result that AtomicMorph should return to its caller.
type AtomicMorpherUint64 ¶
AtomicMorpherUint64 identifies a method passed to and invoked by the AtomicMorphUint64 function. The AtomicMorpher callback is passed a startValue and based on this value it returns what the new value should be and the result that AtomicMorph should return to its caller.
type BlobTransferAttributes ¶
type BlobTransferAttributes struct { //BlobType BlobType // The type of a blob - BlockBlob, PageBlob, AppendBlob ContentType string //The content type specified for the blob. ContentEncoding string //Specifies which content encodings have been applied to the blob. BlockBlobTier BlockBlobTier // Specifies the tier to set on the block blobs. PageBlobTier PageBlobTier // Specifies the tier to set on the page blobs. Metadata string //User-defined name-value pairs associated with the blob NoGuessMimeType bool // represents user decision to interpret the content-encoding from source file PreserveLastModifiedTime bool // when downloading, tell engine to set file's timestamp to timestamp of blob BlockSizeInBytes uint32 }
This struct represents the optional attribute for blob request header
type BlockBlobTier ¶
type BlockBlobTier uint8
func (BlockBlobTier) Archive ¶
func (BlockBlobTier) Archive() BlockBlobTier
func (BlockBlobTier) Cold ¶
func (BlockBlobTier) Cold() BlockBlobTier
func (BlockBlobTier) Cool ¶
func (BlockBlobTier) Cool() BlockBlobTier
func (BlockBlobTier) Hot ¶
func (BlockBlobTier) Hot() BlockBlobTier
func (BlockBlobTier) MarshalJSON ¶
func (bbt BlockBlobTier) MarshalJSON() ([]byte, error)
func (BlockBlobTier) None ¶
func (BlockBlobTier) None() BlockBlobTier
func (*BlockBlobTier) Parse ¶
func (bbt *BlockBlobTier) Parse(s string) error
func (BlockBlobTier) String ¶
func (bbt BlockBlobTier) String() string
func (BlockBlobTier) ToAccessTierType ¶
func (bbt BlockBlobTier) ToAccessTierType() azblob.AccessTierType
func (*BlockBlobTier) UnmarshalJSON ¶
func (bbt *BlockBlobTier) UnmarshalJSON(b []byte) error
Implementing UnmarshalJSON() method for type BlockBlobTier.
type ByteSlice ¶
type ByteSlice []byte
///////////////////////////////////////////////////////////////////////////////////////////////
type ByteSliceExtension ¶
type ByteSliceExtension struct {
ByteSlice
}
func (ByteSliceExtension) RemoveBOM ¶
func (bs ByteSliceExtension) RemoveBOM() []byte
RemoveBOM removes any BOM from the byte slice
type CopyJobPartOrderRequest ¶
type CopyJobPartOrderRequest struct { Version Version // version of the azcopy JobID JobID // Guid - job identifier PartNum PartNumber // part number of the job IsFinalPart bool // to determine the final part for a specific job ForceWrite bool // to determine if the existing needs to be overwritten or not. If set to true, existing blobs are overwritten Priority JobPriority // priority of the task FromTo FromTo Include map[string]int Exclude map[string]int Transfers []CopyTransfer LogLevel LogLevel BlobAttributes BlobTransferAttributes SourceSAS string DestinationSAS string // commandString hold the user given command which is logged to the Job log file CommandString string CredentialInfo CredentialInfo }
This struct represents the job info (a single part) to be sent to the storage engine
type CopyTransfer ¶
type CopyTransfer struct { Source string Destination string LastModifiedTime time.Time //represents the last modified time of source which ensures that source hasn't changed while transferring SourceSize int64 // size of the source entity in bytes. // Properties for service to service copy ContentType string ContentEncoding string ContentDisposition string ContentLanguage string CacheControl string ContentMD5 []byte Metadata Metadata // Properties for blob copy only BlobType azblob.BlobType }
This struct represent a single transfer entry with source and destination details
type CountPerSecond ¶
type CountPerSecond interface { // Add atomically adds delta to *addr and returns the new value. // To subtract a signed positive constant value c, do Add(^uint64(c-1)). Add(delta uint64) uint64 // Pass 0 to get the current count value LatestRate() float64 Reset() }
CountPerSecond ...
func NewCountPerSecond ¶
func NewCountPerSecond() CountPerSecond
type CredCache ¶
type CredCache struct {
// contains filtered or unexported fields
}
CredCache manages credential caches. Use keyring in Linux OS. Session keyring is choosed, the session hooks key should be created since user first login (i.e. by pam). So the session is inherited by processes created from login session. When user logout, the session keyring is recycled.
func (*CredCache) HasCachedToken ¶
HasCachedToken returns if there is cached token for current executing user.
func (*CredCache) LoadToken ¶
func (c *CredCache) LoadToken() (*OAuthTokenInfo, error)
LoadToken gets the cached oauth token.
func (*CredCache) RemoveCachedToken ¶
RemoveCachedToken deletes the cached token.
func (*CredCache) SaveToken ¶
func (c *CredCache) SaveToken(token OAuthTokenInfo) error
SaveToken saves an oauth token.
type CredentialInfo ¶
type CredentialInfo struct { CredentialType CredentialType OAuthTokenInfo OAuthTokenInfo }
CredentialInfo contains essential credential info which need be transited between modules, and used during creating Azure storage client Credential.
type CredentialOpOptions ¶
type CredentialOpOptions struct { LogInfo func(string) LogError func(string) Panic func(error) CallerID string // Used to cancel operations, if fatal error happend during operation. Cancel context.CancelFunc }
CredentialOpOptions contains credential operations' parameters.
type CredentialType ¶
type CredentialType uint8
CredentialType defines the different types of credentials
func (CredentialType) Anonymous ¶
func (CredentialType) Anonymous() CredentialType
func (CredentialType) OAuthToken ¶
func (CredentialType) OAuthToken() CredentialType
func (*CredentialType) Parse ¶
func (ct *CredentialType) Parse(s string) error
func (CredentialType) SharedKey ¶
func (CredentialType) SharedKey() CredentialType
func (CredentialType) String ¶
func (ct CredentialType) String() string
func (CredentialType) Unknown ¶
func (CredentialType) Unknown() CredentialType
type FileURLPartsExtension ¶
type FileURLPartsExtension struct {
azfile.FileURLParts
}
///////////////////////////////////////////////////////////////////////////////////////////////
func (FileURLPartsExtension) GetServiceURL ¶
func (parts FileURLPartsExtension) GetServiceURL() url.URL
func (FileURLPartsExtension) GetShareURL ¶
func (parts FileURLPartsExtension) GetShareURL() url.URL
type FromTo ¶
type FromTo uint16
FromTo defines the different types of sources/destination location combinations FromTo is 16 bit where first 8 bit represents the from location and other 8 bits represents the to location
func (FromTo) BlobFSLocal ¶
func (FromTo) LocalBlobFS ¶
type GetJobFromToRequest ¶
type GetJobFromToRequest struct {
JobID JobID
}
GetJobFromToRequest indicates request to get job's FromTo info from job part plan header
type GetJobFromToResponse ¶
GetJobFromToResponse indicates response to get job's FromTo info.
type HTTPResponseExtension ¶
///////////////////////////////////////////////////////////////////////////////////////////////
func (HTTPResponseExtension) IsSuccessStatusCode ¶
func (r HTTPResponseExtension) IsSuccessStatusCode(successStatusCodes ...int) bool
IsSuccessStatusCode checks if response's status code is contained in specified success status codes.
type ILoggerCloser ¶
type ILoggerCloser interface { ILogger CloseLog() }
func NewAppLogger ¶
func NewAppLogger(minimumLevelToLog pipeline.LogLevel, logFileFolder string) ILoggerCloser
type ILoggerResetable ¶
type ILoggerResetable interface { OpenLog() MinimumLogLevel() pipeline.LogLevel ILoggerCloser }
func NewJobLogger ¶
func NewJobLogger(jobID JobID, minimumLevelToLog LogLevel, appLogger ILogger, logFileFolder string) ILoggerResetable
type IdentityInfo ¶
type IdentityInfo struct { ClientID string `json:"_identity_client_id"` ObjectID string `json:"_identity_object_id"` MSIResID string `json:"_identity_msi_res_id"` }
IdentityInfo contains info for MSI.
func (*IdentityInfo) Validate ¶
func (identityInfo *IdentityInfo) Validate() error
Validate validates identity info, at most only one of clientID, objectID or MSI resource ID could be set.
type JobID ¶
type JobID UUID
func ParseJobID ¶
func (JobID) MarshalJSON ¶
Implementing MarshalJSON() method for type JobID
func (*JobID) UnmarshalJSON ¶
Implementing UnmarshalJSON() method for type JobID
type JobIDDetails ¶
type JobPriority ¶
type JobPriority uint8
JobPriority defines the transfer priorities supported by the Storage Transfer Engine's channels The default priority is Normal
func (JobPriority) Low ¶
func (JobPriority) Low() JobPriority
func (JobPriority) Normal ¶
func (JobPriority) Normal() JobPriority
func (JobPriority) String ¶
func (jp JobPriority) String() string
type JobStatus ¶
type JobStatus uint32 // Must be 32-bit for atomic operations
JobStatus indicates the status of a Job; the default is InProgress.
func (*JobStatus) AtomicLoad ¶
func (*JobStatus) AtomicStore ¶
func (JobStatus) Cancelling ¶
func (JobStatus) InProgress ¶
func (JobStatus) MarshalJSON ¶
Implementing MarshalJSON() method for type JobStatus
func (*JobStatus) UnmarshalJSON ¶
Implementing UnmarshalJSON() method for type JobStatus
type LifecycleMgr ¶
type LifecycleMgr interface { Progress(string) // print on the same line over and over again, not allowed to float up Info(string) // simple print, allowed to float up Prompt(string) string // ask the user a question(after erasing the progress), then return the response Exit(string, ExitCode) // exit after printing SurrenderControl() // give up control, this should never return InitiateProgressReporting(WorkController, bool) // start writing progress with another routine }
create a public interface so that consumers outside of this package can refer to the lifecycle manager but they would not be able to instantiate one
func GetLifecycleMgr ¶
func GetLifecycleMgr() LifecycleMgr
type ListContainerResponse ¶
type ListContainerResponse struct {
Blobs []string
}
ListContainerResponse represents the list of blobs within the container.
type ListJobSummaryResponse ¶
type ListJobSummaryResponse struct { ErrorMsg string Timestamp time.Time JobID JobID // TODO: added for debugging purpose. remove later ActiveConnections int64 // CompleteJobOrdered determines whether the Job has been completely ordered or not CompleteJobOrdered bool JobStatus JobStatus TotalTransfers uint32 TransfersCompleted uint32 TransfersFailed uint32 TransfersSkipped uint32 BytesOverWire uint64 TotalBytesTransferred uint64 FailedTransfers []TransferDetail SkippedTransfers []TransferDetail }
represents the JobProgressPercentage Summary response for list command when requested the Job Progress Summary for given JobId
type ListJobTransfersRequest ¶
type ListJobTransfersRequest struct { JobID JobID OfStatus TransferStatus }
type ListJobTransfersResponse ¶
type ListJobTransfersResponse struct { ErrorMsg string JobID JobID Details []TransferDetail }
represents the list of Details and details of number of transfers
type ListJobsResponse ¶
type ListJobsResponse struct { ErrorMessage string JobIDDetails []JobIDDetails }
ListJobsResponse represent the Job with JobId and
type ListRequest ¶
type ListRequest struct { JobID JobID OfStatus string // TODO: OfStatus with string type sounds not good, change it to enum Output OutputFormat }
represents the raw list command input from the user when requested the list of transfer with given status for given JobId
type MMF ¶
type MMF struct {
// contains filtered or unexported fields
}
type Metadata ¶
Metadata used in AzCopy.
func FromAzBlobMetadataToCommonMetadata ¶
FromAzBlobMetadataToCommonMetadata converts azblob's metadata to common metadata.
func FromAzFileMetadataToCommonMetadata ¶
FromAzFileMetadataToCommonMetadata converts azfile's metadata to common metadata.
func UnMarshalToCommonMetadata ¶
UnMarshalToCommonMetadata unmarshals string to common metadata.
func (Metadata) ToAzBlobMetadata ¶
ToAzBlobMetadata converts metadata to azblob's metadata.
func (Metadata) ToAzFileMetadata ¶
ToAzFileMetadata converts metadata to azfile's metadata.
type NoCopy ¶
type NoCopy struct {
// contains filtered or unexported fields
}
The NoCopy struct is used as a field inside another struct that should not be copied by value. After embedded this field, the out struct's members can call the Check method which will panic if it detects the out struct has been copied by value.
type OAuthTokenInfo ¶
type OAuthTokenInfo struct { adal.Token Tenant string `json:"_tenant"` ActiveDirectoryEndpoint string `json:"_ad_endpoint"` Identity bool `json:"_identity"` IdentityInfo IdentityInfo }
OAuthTokenInfo contains info necessary for refresh OAuth credentials.
func JSONToTokenInfo ¶
func JSONToTokenInfo(b []byte) (*OAuthTokenInfo, error)
JSONToTokenInfo converts bytes to OAuthTokenInfo
func (*OAuthTokenInfo) GetNewTokenFromMSI ¶
GetNewTokenFromMSI get token from Azure Instance Metadata Service identity endpoint. For details, please refer to https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
func (OAuthTokenInfo) IsEmpty ¶
func (credInfo OAuthTokenInfo) IsEmpty() bool
IsEmpty returns if current OAuthTokenInfo is empty and doesn't contain any useful info.
func (*OAuthTokenInfo) RefreshTokenWithUserCredential ¶
func (credInfo *OAuthTokenInfo) RefreshTokenWithUserCredential(ctx context.Context) (*adal.Token, error)
RefreshTokenWithUserCredential get new token with user credential through refresh.
func (OAuthTokenInfo) ToJSON ¶
func (credInfo OAuthTokenInfo) ToJSON() ([]byte, error)
ToJSON converts OAuthTokenInfo to json format.
type OutputFormat ¶
type OutputFormat uint32
func (OutputFormat) Json ¶
func (OutputFormat) Json() OutputFormat
func (OutputFormat) None ¶
func (OutputFormat) None() OutputFormat
func (*OutputFormat) Parse ¶
func (of *OutputFormat) Parse(s string) error
func (OutputFormat) Text ¶
func (OutputFormat) Text() OutputFormat
type PageBlobTier ¶
type PageBlobTier uint8
func (PageBlobTier) MarshalJSON ¶
func (pbt PageBlobTier) MarshalJSON() ([]byte, error)
func (PageBlobTier) None ¶
func (PageBlobTier) None() PageBlobTier
func (PageBlobTier) P10 ¶
func (PageBlobTier) P10() PageBlobTier
func (PageBlobTier) P20 ¶
func (PageBlobTier) P20() PageBlobTier
func (PageBlobTier) P30 ¶
func (PageBlobTier) P30() PageBlobTier
func (PageBlobTier) P4 ¶
func (PageBlobTier) P4() PageBlobTier
func (PageBlobTier) P40 ¶
func (PageBlobTier) P40() PageBlobTier
func (PageBlobTier) P50 ¶
func (PageBlobTier) P50() PageBlobTier
func (PageBlobTier) P6 ¶
func (PageBlobTier) P6() PageBlobTier
func (*PageBlobTier) Parse ¶
func (pbt *PageBlobTier) Parse(s string) error
func (PageBlobTier) String ¶
func (pbt PageBlobTier) String() string
func (PageBlobTier) ToAccessTierType ¶
func (pbt PageBlobTier) ToAccessTierType() azblob.AccessTierType
func (*PageBlobTier) UnmarshalJSON ¶
func (pbt *PageBlobTier) UnmarshalJSON(b []byte) error
Implementing UnmarshalJSON() method for type BlockBlobTier.
type PartNumber ¶
type PartNumber uint32
type ResumeJobRequest ¶
type RpcCmd ¶
type RpcCmd string
JobStatus indicates the status of a Job; the default is InProgress.
func (RpcCmd) CopyJobPartOrder ¶
func (RpcCmd) GetJobFromTo ¶
func (RpcCmd) ListJobSummary ¶
func (RpcCmd) ListJobTransfers ¶
type SyncJobPartOrderRequest ¶
type SyncJobPartOrderRequest struct { JobID JobID FromTo FromTo PartNumber PartNumber LogLevel LogLevel Include map[string]int Exclude map[string]int BlockSizeInBytes uint32 SourceSAS string DestinationSAS string CopyJobRequest CopyJobPartOrderRequest DeleteJobRequest CopyJobPartOrderRequest // FilesDeletedLocally is used to keep track of the file that are deleted locally // Since local files to delete are not sent as transfer to STE // the count of the local files deletion is tracked using it. FilesDeletedLocally int // commandString hold the user given command which is logged to the Job log file CommandString string CredentialInfo CredentialInfo }
type TestOAuthInjection ¶
TestOAuthInjection controls variables for OAuth testing injections
type TransferDetail ¶
type TransferDetail struct { Src string Dst string TransferStatus TransferStatus ErrorCode int32 }
represents the Details and details of a single transfer
type TransferStatus ¶
type TransferStatus int32 // Must be 32-bit for atomic operations; negative #s represent a specific failure code
func (TransferStatus) All ¶
func (TransferStatus) All() TransferStatus
Transfer is any of the three possible state (InProgress, Completer or Failed)
func (*TransferStatus) AtomicLoad ¶
func (ts *TransferStatus) AtomicLoad() TransferStatus
func (*TransferStatus) AtomicStore ¶
func (ts *TransferStatus) AtomicStore(newTransferStatus TransferStatus)
func (TransferStatus) BlobAlreadyExistsFailure ¶
func (TransferStatus) BlobAlreadyExistsFailure() TransferStatus
func (TransferStatus) BlobTierFailure ¶
func (TransferStatus) BlobTierFailure() TransferStatus
Transfer failed due to failure while Setting blob tier.
func (TransferStatus) DidFail ¶
func (ts TransferStatus) DidFail() bool
func (TransferStatus) Failed ¶
func (TransferStatus) Failed() TransferStatus
Transfer failed due to some error. This status does represent the state when transfer is cancelled
func (TransferStatus) FileAlreadyExistsFailure ¶
func (TransferStatus) FileAlreadyExistsFailure() TransferStatus
func (TransferStatus) MarshalJSON ¶
func (ts TransferStatus) MarshalJSON() ([]byte, error)
Implementing MarshalJSON() method for type Transfer Status
func (TransferStatus) NotStarted ¶
func (TransferStatus) NotStarted() TransferStatus
Transfer is ready to transfer and not started transferring yet
func (*TransferStatus) Parse ¶
func (ts *TransferStatus) Parse(s string) error
func (TransferStatus) ShouldTransfer ¶
func (ts TransferStatus) ShouldTransfer() bool
func (TransferStatus) Started ¶
func (TransferStatus) Started() TransferStatus
Transfer started & at least 1 chunk has successfully been transfered. Used to resume a transfer that started to avoid transfering all chunks thereby improving performance
func (TransferStatus) String ¶
func (ts TransferStatus) String() string
func (TransferStatus) Success ¶
func (TransferStatus) Success() TransferStatus
Transfer successfully completed
func (*TransferStatus) UnmarshalJSON ¶
func (ts *TransferStatus) UnmarshalJSON(b []byte) error
Implementing UnmarshalJSON() method for type Transfer Status
type URLExtension ¶
///////////////////////////////////////////////////////////////////////////////////////////////
func (URLExtension) RedactSigQueryParamForLogging ¶
func (u URLExtension) RedactSigQueryParamForLogging() string
type URLStringExtension ¶
type URLStringExtension string
///////////////////////////////////////////////////////////////////////////////////////////////
func (URLStringExtension) RedactSigQueryParamForLogging ¶
func (s URLStringExtension) RedactSigQueryParamForLogging() string
type UUID ¶
A UUID representation compliant with specification in RFC 4122 document.
func ParseUUID ¶
ParseUUID parses a string formatted as "003020100-0504-0706-0809-0a0b0c0d0e0f" or "{03020100-0504-0706-0809-0a0b0c0d0e0f}" into a UUID.
func (UUID) MarshalJSON ¶
Implementing MarshalJSON() method for type UUID
func (*UUID) UnmarshalJSON ¶
Implementing UnmarshalJSON() method for type UUID
type UserOAuthTokenManager ¶
type UserOAuthTokenManager struct {
// contains filtered or unexported fields
}
UserOAuthTokenManager for token management.
func NewUserOAuthTokenManagerInstance ¶
func NewUserOAuthTokenManagerInstance(userTokenCachePath string) *UserOAuthTokenManager
NewUserOAuthTokenManagerInstance creates a token manager instance.
func (*UserOAuthTokenManager) GetCachedTokenInfo ¶
func (uotm *UserOAuthTokenManager) GetCachedTokenInfo(ctx context.Context) (*OAuthTokenInfo, error)
GetCachedTokenInfo get a fresh token from local disk cache. If access token is expired, it will refresh the token. If refresh token is expired, the method will fail and return failure reason. Fresh token is persisted if acces token or refresh token is changed.
func (*UserOAuthTokenManager) GetTokenInfo ¶
func (uotm *UserOAuthTokenManager) GetTokenInfo(ctx context.Context) (*OAuthTokenInfo, error)
GetTokenInfo gets token info, it follows rule:
- If there is token passed from environment variable(note this is only for testing purpose), use token passed from environment variable.
- Otherwise, try to get token from cache.
This method either successfully return token, or return error.
func (*UserOAuthTokenManager) GetTokenInfoFromEnvVar ¶
func (uotm *UserOAuthTokenManager) GetTokenInfoFromEnvVar(ctx context.Context) (*OAuthTokenInfo, error)
GetTokenInfoFromEnvVar gets token info from environment variable.
func (*UserOAuthTokenManager) HasCachedToken ¶
func (uotm *UserOAuthTokenManager) HasCachedToken() (bool, error)
HasCachedToken returns if there is cached token in token manager.
func (*UserOAuthTokenManager) MSILogin ¶
func (uotm *UserOAuthTokenManager) MSILogin(ctx context.Context, identityInfo IdentityInfo, persist bool) (*OAuthTokenInfo, error)
MSILogin tries to get token from MSI, persist indicates whether to cache the token on local disk.
func (*UserOAuthTokenManager) RemoveCachedToken ¶
func (uotm *UserOAuthTokenManager) RemoveCachedToken() error
RemoveCachedToken delete all the cached token.
func (*UserOAuthTokenManager) UserLogin ¶
func (uotm *UserOAuthTokenManager) UserLogin(tenantID, activeDirectoryEndpoint string, persist bool) (*OAuthTokenInfo, error)
UserLogin interactively logins in with specified tenantID and activeDirectoryEndpoint, persist indicates whether to cache the token on local disk.
type WorkController ¶
type WorkController interface { Cancel(mgr LifecycleMgr) // handle to cancel the work ReportProgressOrExit(mgr LifecycleMgr) // print the progress status, optionally exit the application if work is done }
for the lifecycleMgr to babysit a job, it must be given a controller to get information about the job