azblob

package
v0.0.0-...-167e338 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpHealthCheck   = "HealthCheck"
	OpGetObject     = "GetObject"
	OpPutObject     = "PutObject"
	OpDeleteObject  = "DeleteObject"
	OpStatObject    = "StatObject"
	OpGetRequest    = "GetRequest"
	OpDeleteRequest = "DeleteRequest"
	OpPutRequest    = "PutRequest"
)
View Source
const (
	BufferSizeMin     = 4 * 1024          // 4KiB
	BufferSizeDefault = 8 * BufferSizeMin // 32KiB - same default as used in io.Copy
)

Variables

View Source
var (
	ErrStorageSettings = errors.New("storage settings invalid")
	ErrEmptyClient     = errors.New("storage client not configured")
)
View Source
var (
	ErrConnStrNoName = errors.New("connection string does not contain an account name")
	ErrConnStrNoKey  = errors.New("connection string does not contain an account key")
)

Functions

func New

func New(ctx context.Context, bucket string, opts ...*Options) (storage.ObjectStorage, error)

func NewEmpty

func NewEmpty(ctx context.Context, opts ...*Options) (storage.ObjectStorage, error)

Types

type OpError

type OpError struct {
	Op      string
	Message string
	Reason  error
}

func (OpError) Error

func (err OpError) Error() string

func (OpError) Unwrap

func (err OpError) Unwrap() error

type Options

type Options struct {
	ConnectionString *string
	SharedKey        *SharedKeyCredentials

	ProxyURI *url.URL

	BufferSize int64

	ContentType *string
}

func NewOptions

func NewOptions(opts ...*Options) *Options

func (*Options) SetBufferSize

func (opts *Options) SetBufferSize(size int64) *Options

func (*Options) SetConnectionString

func (opts *Options) SetConnectionString(connStr string) *Options

func (*Options) SetContentType

func (opts *Options) SetContentType(typ string) *Options

func (*Options) SetProxyURI

func (opts *Options) SetProxyURI(proxyURI *url.URL) *Options

func (*Options) SetSharedKey

func (opts *Options) SetSharedKey(sk SharedKeyCredentials) *Options

type SharedKeyCredentials

type SharedKeyCredentials struct {
	AccountName string
	AccountKey  string

	URI *string // Optional
}

Jump to

Keyboard shortcuts

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