Documentation ¶
Index ¶
- Constants
- Variables
- func AddCommonBlobRequestHeaders(header http.Header)
- func DownloadBlob(ctx context.Context, httpClient *retryablehttp.Client, blobUri string, ...) (*readData, error)
- func Gen(byteCount int64, outputWriter io.Writer) error
- func GetFreePort() (port int, err error)
- func GetUriFromAccessString(accessString string) (*url.URL, error)
- func NewSshTunnelPool(ctx context.Context, sshParams client.SshParams, count int) *sshTunnelPool
- func Read(ctx context.Context, uri *url.URL, outputWriter io.Writer, ...) error
- func RelayInputServer(ctx context.Context, listeners []net.Listener, bufferId string, ...) error
- func RelayOutputServer(ctx context.Context, listeners []net.Listener, containerId string, ...) error
- func ValidateSas(containerId string, action SasAction, queryString url.Values, ...) error
- func Write(ctx context.Context, uri *url.URL, inputReader io.Reader, ...) error
- type BufferBlob
- type BufferEndMetadata
- type BufferStartMetadata
- type BufferStatus
- type Container
- type MergedContext
- type PartiallyBufferedReader
- type ReadOption
- type ReaderWithMetrics
- type SasAction
- type TransferMetrics
- type ValidateSignatureFunc
- type WriteOption
- func WithWriteBlockSize(blockSize int) WriteOption
- func WithWriteDop(dop int) WriteOption
- func WithWriteFlushInterval(flushInterval time.Duration) WriteOption
- func WithWriteHttpClient(httpClient *retryablehttp.Client) WriteOption
- func WithWriteMetadataEndWriteTimeout(timeout time.Duration) WriteOption
Constants ¶
View Source
const ( CurrentBufferFormatVersion = "0.3.0" BufferStatusComplete BufferStatus = "complete" BufferStatusFailed BufferStatus = "failed" HashChainHeader = "x-ms-meta-cumulative_hash_chain" ContentMD5Header = "Content-MD5" StartMetadataBlobName = ".bufferstart" EndMetadataBlobName = ".bufferend" )
View Source
const ( DefaultReadDop = 32 MaxRetries = 6 ResponseTimeout = 100 * time.Second )
View Source
const ( DefaultWriteDop = 16 DefaultBlockSize = 4 * 1024 * 1024 EncodedHashChainInitialValue = "MDAwMDAwMDAwMDAwMDAwMA==" )
View Source
const CurrentSasVersion = "0.1.0"
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrBufferFailedState = errors.New("the buffer is in a permanently failed state") )
View Source
var ( ErrInvalidSas = errors.New("the SAS token is not valid") ErrSasActionNotAllowed = errors.New("the requested action is not permissed with the given SAS token") )
View Source
var (
DefaultFlushInterval = 1 * time.Second
)
View Source
var (
ErrAccessStringNotUri = errors.New("the buffer access string is invalid. It must be a URI or the path of a file whose contents is a URI")
)
Functions ¶
func DownloadBlob ¶
func GetFreePort ¶
func NewSshTunnelPool ¶
func RelayInputServer ¶
func RelayOutputServer ¶
func RelayOutputServer( ctx context.Context, listeners []net.Listener, containerId string, inputReaderChan <-chan io.ReadCloser, errorChan <-chan error, validateSignatureFunc ValidateSignatureFunc, ) error
func ValidateSas ¶
Types ¶
type BufferBlob ¶
type BufferEndMetadata ¶
type BufferEndMetadata struct {
Status BufferStatus `json:"status"`
}
type BufferStartMetadata ¶
type BufferStartMetadata struct {
Version string `json:"version"`
}
type BufferStatus ¶
type BufferStatus string
type Container ¶
func (*Container) GetBlobUri ¶
func (*Container) GetContainerName ¶
func (*Container) GetEndMetadataUri ¶
func (*Container) GetStartMetadataUri ¶
func (*Container) SupportsRelay ¶
type MergedContext ¶
type MergedContext struct { context.Context // The context that is is used for deadlines and cancellation // contains filtered or unexported fields }
func (*MergedContext) Value ¶
func (c *MergedContext) Value(key any) any
type PartiallyBufferedReader ¶
An io.Reader that stores the first N bytes read from the underlying reader as they are read so that it can be rewound and read again, if <= N bytes were read.
func NewPartiallyBufferedReader ¶
func NewPartiallyBufferedReader(r io.Reader, capacity int) *PartiallyBufferedReader
func (*PartiallyBufferedReader) Read ¶
func (r *PartiallyBufferedReader) Read(p []byte) (n int, err error)
func (*PartiallyBufferedReader) Rewind ¶
func (r *PartiallyBufferedReader) Rewind() error
type ReadOption ¶
type ReadOption func(o *readOptions)
func WithReadDop ¶
func WithReadDop(dop int) ReadOption
func WithReadHttpClient ¶
func WithReadHttpClient(httpClient *retryablehttp.Client) ReadOption
type ReaderWithMetrics ¶
type ReaderWithMetrics struct {
// contains filtered or unexported fields
}
type TransferMetrics ¶
type TransferMetrics struct {
// contains filtered or unexported fields
}
func NewTransferMetrics ¶
func NewTransferMetrics(ctx context.Context) *TransferMetrics
func (*TransferMetrics) Stop ¶
func (ts *TransferMetrics) Stop()
func (*TransferMetrics) Update ¶
func (ts *TransferMetrics) Update(byteCount uint64, completedBuffers uint64)
type ValidateSignatureFunc ¶
func CreateSignatureValidationFunc ¶
func CreateSignatureValidationFunc(primarySigningPublicKeyPath, secondarySigningPublicKeyPath string) (ValidateSignatureFunc, error)
type WriteOption ¶
type WriteOption func(o *writeOptions)
func WithWriteBlockSize ¶
func WithWriteBlockSize(blockSize int) WriteOption
func WithWriteDop ¶
func WithWriteDop(dop int) WriteOption
func WithWriteFlushInterval ¶
func WithWriteFlushInterval(flushInterval time.Duration) WriteOption
func WithWriteHttpClient ¶
func WithWriteHttpClient(httpClient *retryablehttp.Client) WriteOption
func WithWriteMetadataEndWriteTimeout ¶
func WithWriteMetadataEndWriteTimeout(timeout time.Duration) WriteOption
Click to show internal directories.
Click to hide internal directories.