storage

package
v0.0.0-...-91baed5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBaseUrl    = "core.windows.net"
	DefaultApiVersion = "2014-02-14"
)
View Source
const MaxBlobBlockSize = 4 * 1024 * 1024

Variables

View Source
var (
	ErrNotCreated  = errors.New("storage: operation has returned a successful error code other than 201 Created.")
	ErrNotAccepted = errors.New("storage: operation has returned a successful error code other than 202 Accepted.")
)

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Name       string         `xml:"Name"`
	Properties BlobProperties `xml:"Properties"`
}

type BlobListResponse

type BlobListResponse struct {
	XMLName    xml.Name `xml:"EnumerationResults"`
	Xmlns      string   `xml:"xmlns,attr"`
	Prefix     string   `xml:"Prefix"`
	Marker     string   `xml:"Marker"`
	NextMarker string   `xml:"NextMarker"`
	MaxResults int64    `xml:"MaxResults"`
	Blobs      []Blob   `xml:"Blobs>Blob"`
}

type BlobProperties

type BlobProperties struct {
	LastModified          string `xml:"Last-Modified"`
	Etag                  string `xml:"Etag"`
	ContentMD5            string `xml:"Content-MD5"`
	ContentLength         uint64 `xml:"Content-Length"`
	ContentType           string `xml:"Content-Type"`
	ContentEncoding       string `xml:"Content-Encoding"`
	SequenceNumber        int64  `xml:"x-ms-blob-sequence-number"`
	CopyId                string `xml:"CopyId"`
	CopyStatus            string `xml:"CopyStatus"`
	CopySource            string `xml:"CopySource"`
	CopyProgress          string `xml:"CopyProgress"`
	CopyCompletionTime    string `xml:"CopyCompletionTime"`
	CopyStatusDescription string `xml:"CopyStatusDescription"`
}

type BlobStorageClient

type BlobStorageClient struct {
	// contains filtered or unexported fields
}

func (BlobStorageClient) BlobExists

func (b BlobStorageClient) BlobExists(container, name string) (bool, error)

func (BlobStorageClient) ContainerExists

func (b BlobStorageClient) ContainerExists(container string) (bool, error)

func (BlobStorageClient) CopyBlob

func (b BlobStorageClient) CopyBlob(container, name, sourceBlob string) error

func (BlobStorageClient) CreateContainer

func (b BlobStorageClient) CreateContainer(name string, access ContainerAccessType) error

func (BlobStorageClient) CreateContainerIfNotExists

func (b BlobStorageClient) CreateContainerIfNotExists(name string, access ContainerAccessType) (bool, error)

func (BlobStorageClient) DeleteBlob

func (b BlobStorageClient) DeleteBlob(container, name string) error

func (BlobStorageClient) DeleteBlobIfExists

func (b BlobStorageClient) DeleteBlobIfExists(container, name string) (bool, error)

func (BlobStorageClient) DeleteContainer

func (b BlobStorageClient) DeleteContainer(name string) error

func (BlobStorageClient) DeleteContainerIfExists

func (b BlobStorageClient) DeleteContainerIfExists(container string) (bool, error)

func (BlobStorageClient) GetBlob

func (b BlobStorageClient) GetBlob(container, name string) (io.ReadCloser, error)

func (BlobStorageClient) GetBlobProperties

func (b BlobStorageClient) GetBlobProperties(container, name string) (*BlobProperties, error)

func (BlobStorageClient) GetBlobRange

func (b BlobStorageClient) GetBlobRange(container, name, bytesRange string) (io.ReadCloser, error)

func (BlobStorageClient) GetBlobSASURI

func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Time, permissions string) (string, error)

func (BlobStorageClient) GetBlobUrl

func (b BlobStorageClient) GetBlobUrl(container, name string) string

func (BlobStorageClient) GetBlockList

func (b BlobStorageClient) GetBlockList(container, name string, blockType BlockListType) (BlockListResponse, error)

func (BlobStorageClient) ListBlobs

func (b BlobStorageClient) ListBlobs(container string, params ListBlobsParameters) (BlobListResponse, error)

func (BlobStorageClient) ListContainers

func (BlobStorageClient) PutBlock

func (b BlobStorageClient) PutBlock(container, name, blockId string, chunk []byte) error

func (BlobStorageClient) PutBlockBlob

func (b BlobStorageClient) PutBlockBlob(container, name string, blob io.Reader) error

func (BlobStorageClient) PutBlockList

func (b BlobStorageClient) PutBlockList(container, name string, blocks []Block) error

func (BlobStorageClient) PutBlockWithLength

func (b BlobStorageClient) PutBlockWithLength(container, name, blockId string, size uint64, blob io.Reader) error

type BlobType

type BlobType string
const (
	BlobTypeBlock BlobType = "BlockBlob"
	BlobTypePage  BlobType = "PageBlob"
)

type Block

type Block struct {
	Id     string
	Status BlockStatus
}

type BlockListResponse

type BlockListResponse struct {
	XMLName           xml.Name        `xml:"BlockList"`
	CommittedBlocks   []BlockResponse `xml:"CommittedBlocks>Block"`
	UncommittedBlocks []BlockResponse `xml:"UncommittedBlocks>Block"`
}

type BlockListType

type BlockListType string
const (
	BlockListTypeAll         BlockListType = "all"
	BlockListTypeCommitted   BlockListType = "committed"
	BlockListTypeUncommitted BlockListType = "uncommitted"
)

type BlockResponse

type BlockResponse struct {
	Name string `xml:"Name"`
	Size uint64 `xml:"Size"`
}

type BlockStatus

type BlockStatus string
const (
	BlockStatusUncommitted BlockStatus = "Uncommitted"
	BlockStatusCommitted   BlockStatus = "Committed"
	BlockStatusLatest      BlockStatus = "Latest"
)

type Container

type Container struct {
	Name       string              `xml:"Name"`
	Properties ContainerProperties `xml:"Properties"`
}

type ContainerAccessType

type ContainerAccessType string
const (
	ContainerAccessTypePrivate   ContainerAccessType = ""
	ContainerAccessTypeBlob      ContainerAccessType = "blob"
	ContainerAccessTypeContainer ContainerAccessType = "container"
)

type ContainerListResponse

type ContainerListResponse struct {
	XMLName    xml.Name    `xml:"EnumerationResults"`
	Xmlns      string      `xml:"xmlns,attr"`
	Prefix     string      `xml:"Prefix"`
	Marker     string      `xml:"Marker"`
	NextMarker string      `xml:"NextMarker"`
	MaxResults int64       `xml:"MaxResults"`
	Containers []Container `xml:"Containers>Container"`
}

type ContainerProperties

type ContainerProperties struct {
	LastModified  string `xml:"Last-Modified"`
	Etag          string `xml:"Etag"`
	LeaseStatus   string `xml:"LeaseStatus"`
	LeaseState    string `xml:"LeaseState"`
	LeaseDuration string `xml:"LeaseDuration"`
}

type ListBlobsParameters

type ListBlobsParameters struct {
	Prefix     string
	Delimiter  string
	Marker     string
	Include    string
	MaxResults uint
	Timeout    uint
}

func (ListBlobsParameters) GetParameters

func (p ListBlobsParameters) GetParameters() url.Values

type ListContainersParameters

type ListContainersParameters struct {
	Prefix     string
	Marker     string
	Include    string
	MaxResults uint
	Timeout    uint
}

func (ListContainersParameters) GetParameters

func (p ListContainersParameters) GetParameters() url.Values

type StorageClient

type StorageClient struct {
	// contains filtered or unexported fields
}

func NewBasicClient

func NewBasicClient(accountName, accountKey string) (*StorageClient, error)

func NewClient

func NewClient(accountName, accountKey, blobServiceBaseUrl, apiVersion string, useHttps bool) (*StorageClient, error)

func (StorageClient) GetBlobService

func (c StorageClient) GetBlobService() *BlobStorageClient

type StorageServiceError

type StorageServiceError struct {
	Code                      string `xml:"Code"`
	Message                   string `xml:"Message"`
	AuthenticationErrorDetail string `xml:"AuthenticationErrorDetail"`
	QueryParameterName        string `xml:"QueryParameterName"`
	QueryParameterValue       string `xml:"QueryParameterValue"`
	Reason                    string `xml:"Reason"`
	StatusCode                int
	RequestId                 string
}

func (StorageServiceError) Error

func (e StorageServiceError) Error() string

Jump to

Keyboard shortcuts

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