storage

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAzureConfig

func CreateAzureConfig(account string, key string) stow.ConfigMap

CreateAzureConfig create azure configuration

func CreateS3Config

func CreateS3Config(accessKeyID string, secretKey string, region string, endpoint string) stow.ConfigMap

CreateS3Config create S3 configuration

func Init

func Init(cloudStorageConfig *types.CloudStorageConfig) (stow.ConfigMap, string, string, error)

Init cloud storage config

func InitBlobStorage

func InitBlobStorage(cloudStorageConfig *types.CloudStorageConfig) (stow.ConfigMap, string)

InitBlobStorage inits the storage with the supplied credentials

func InitS3

func InitS3(cloudStorageConfig *types.CloudStorageConfig) (stow.ConfigMap, string)

InitS3 inits the storage with the supplied credentials

func PutItem

func PutItem(name string, content string, container stow.Container) error

PutItem writes a new item to the container

func ReadObject

func ReadObject(item stow.Item) (string, error)

ReadObject reads the item's content

Types

type API

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

API storage

func New

func New(kind string, config stow.Config, concurrencyLimit int) (*API, error)

New initialize a new storage instance. Kind is the storage kind: s3/blob storage/ google cloud. config holds the storage connection string concurrencyLimit is the limit for how many item needs to be scanned at once.

func (*API) CreateContainer

func (a *API) CreateContainer(name string) (stow.Container, error)

CreateContainer create a container/bucket or return a reference if already exists

func (*API) RemoveContainer

func (a *API) RemoveContainer(name string) error

RemoveContainer removes a container/bucket from the storage

func (*API) WalkFiles

func (a *API) WalkFiles(container stow.Container, walkFunc walkFunc) error

WalkFiles walks over the files in 'container' and executes fn func

Jump to

Keyboard shortcuts

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