storage

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAddressEncodingName = storage.Base64EncodingName

Variables

Functions

func StoreFromStorageConfig

func StoreFromStorageConfig(storageConfig *StorageConfig, logger log.Logger) (storage.NamedStore, error)

Types

type CloudConfig

type CloudConfig struct {
	Bucket string
	Prefix string
	Region string
}

type FileSystemConfig

type FileSystemConfig struct {
	RootDirectory string
}

type IPFSConfig

type IPFSConfig struct {
	RemoteAPI string
}

type StorageConfig

type StorageConfig struct {
	// Acts a string enum
	StorageType StorageType
	// Address encoding name
	AddressEncoding string
	// Embedding a pointer to each type of config struct allows us to access the
	// relevant one, while at the same time those that are left as nil will be
	// omitted from being serialised.
	*FileSystemConfig
	*CloudConfig
	*IPFSConfig
}

StorageConfig identifies the configured back-end

func ConfigFromString

func ConfigFromString(tomlString string) (*StorageConfig, error)

func DefaultCloudConfig

func DefaultCloudConfig(cloud string) *StorageConfig

func DefaultFileSystemConfig

func DefaultFileSystemConfig() *StorageConfig

func DefaultIPFSConfig

func DefaultIPFSConfig() *StorageConfig

func DefaultMemoryConfig

func DefaultMemoryConfig() *StorageConfig

func GetDefaultConfig

func GetDefaultConfig(c string) (*StorageConfig, error)

func NewCloudConfig

func NewCloudConfig(encoding, cloud, bucket, prefix, region string) (*StorageConfig, error)

func NewFileSystemConfig

func NewFileSystemConfig(addressEncoding, rootDirectory string) *StorageConfig

func NewIPFSConfig

func NewIPFSConfig(addressEncoding, host string) *StorageConfig

func NewMemoryConfig

func NewMemoryConfig(addressEncoding string) *StorageConfig

func NewStorageConfig

func NewStorageConfig(storageType StorageType, addressEncoding string) *StorageConfig

func (*StorageConfig) TOMLString

func (storageConfig *StorageConfig) TOMLString() string

type StorageType

type StorageType string
const (
	Unspecified StorageType = ""
	Memory      StorageType = "memory"
	Filesystem  StorageType = "filesystem"
	AWS         StorageType = "aws"
	Azure       StorageType = "azure"
	GCP         StorageType = "gcp"
	IPFS        StorageType = "ipfs"
)

func GetStorageTypes

func GetStorageTypes() []StorageType

Jump to

Keyboard shortcuts

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