Documentation ¶
Index ¶
- Constants
- Variables
- func StoreFromStorageConfig(storageConfig *StorageConfig, logger log.Logger) (storage.NamedStore, error)
- type CloudConfig
- type FileSystemConfig
- type IPFSConfig
- type StorageConfig
- func ConfigFromString(tomlString string) (*StorageConfig, error)
- func DefaultCloudConfig(cloud string) *StorageConfig
- func DefaultFileSystemConfig() *StorageConfig
- func DefaultIPFSConfig() *StorageConfig
- func DefaultMemoryConfig() *StorageConfig
- func GetDefaultConfig(c string) (*StorageConfig, error)
- func NewCloudConfig(encoding, cloud, bucket, prefix, region string) (*StorageConfig, error)
- func NewFileSystemConfig(addressEncoding, rootDirectory string) *StorageConfig
- func NewIPFSConfig(addressEncoding, host string) *StorageConfig
- func NewMemoryConfig(addressEncoding string) *StorageConfig
- func NewStorageConfig(storageType StorageType, addressEncoding string) *StorageConfig
- type StorageType
Constants ¶
View Source
const DefaultAddressEncodingName = storage.Base64EncodingName
Variables ¶
View Source
var DefaultConfig = NewMemoryConfig(DefaultAddressEncodingName)
Functions ¶
func StoreFromStorageConfig ¶
func StoreFromStorageConfig(storageConfig *StorageConfig, logger log.Logger) (storage.NamedStore, error)
Types ¶
type CloudConfig ¶
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
Click to show internal directories.
Click to hide internal directories.