config

package
v0.0.0-...-c4ae08b Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StorageTypeFlag is the value of the global flag to indicate the storage type
	StorageTypeFlag = "storage-type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Azure

type Azure struct {
	AccountNameFile string `envconfig:"ACCOUNT_NAME_FILE" default:"/var/run/secrets/deis/objectstore/creds/accountname"`
	AccountKeyFile  string `envconfig:"ACCOUNT_KEY_FILE" default:"/var/run/secrets/deis/objectstore/creds/accountkey"`
	ContainerFile   string `envconfig:"CONTAINER_FILE" default:"/var/run/secrets/deis/objectstore/creds/container"`
}

Azure is the Config implementation for the Azure client

func (Azure) CreateDriver

func (a Azure) CreateDriver() (driver.StorageDriver, error)

CreateDriver is the Config interface implementation

func (Azure) String

func (a Azure) String() string

Name is the fmt.Stringer interface implementation

type Config

type Config interface {
	fmt.Stringer
	CreateDriver() (driver.StorageDriver, error)
}

Config is the generic interface from which a storage driver can be created

func FromStorageType

func FromStorageType(st StorageType) (Config, error)

FromStorageType gets a Config implementation from the st param. If there's no known config for the given type, return ErrUnsupportedStorageType. Returns an appropriate error in all other error cases.

func FromStorageTypeString

func FromStorageTypeString(str string) (Config, error)

FromStorageTypeString calls StorageTypeFromString, then calls FromStorageType to get the Config from that storage type. Returns an appropriate error on all failures

type ErrUnknownStorageType

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

ErrUnknownStorageType is an error that indicates that a given storage type string is unknown

func (ErrUnknownStorageType) Error

func (e ErrUnknownStorageType) Error() string

Error is the error interface implementation

type ErrUnsupportedStorageType

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

ErrUnsupportedStorageType is the error returned when a storage type is given that is not currently supported

func (ErrUnsupportedStorageType) Error

type GCS

type GCS struct {
	KeyFile    string `envconfig:"KEY_FILE" default:"/var/run/secrets/deis/objectstore/creds/key.json"`
	BucketFile string `envconfig:"BUCKET_FILE" default:"/var/run/secrets/deis/objectstore/creds/bucket"`
}

GCS is the Config implementation for the GCS client

func (GCS) CreateDriver

func (g GCS) CreateDriver() (driver.StorageDriver, error)

CreateDriver is the Config interface implementation

func (GCS) String

func (g GCS) String() string

String is the fmt.Stringer interface implementation

type Minio

type Minio struct {
	AccessKeyFile    string `envconfig:"ACCESS_KEY_FILE" default:"/var/run/secrets/deis/objectstore/creds/accesskey"`
	AccessSecretFile string `envconfig:"ACCESS_SECRET_FILE" default:"/var/run/secrets/deis/objectstore/creds/secretkey"`
	BucketFile       string `envconfig:"BUCKET_FILE" default:"/var/run/secrets/deis/objectstore/creds/bucket"`
	S3Host           string `envconfig:"S3_HOST" default:"$DEIS_MINIO_SERVICE_HOST"`
	S3Port           string `envconfig:"S3_PORT" default:"$DEIS_MINIO_SERVICE_PORT"`
	Region           string `envconfig:"REGION" default:"us-east-1"`
	Secure           bool   `envconfig:"SECURE" default:"false"`
	V4Auth           bool   `envconfig:"V4_AUTH" default:"true"`
}

Minio is the Config implementation for the Minio client

func (Minio) CreateDriver

func (e Minio) CreateDriver() (driver.StorageDriver, error)

CreateDriver is the Config interface implementation

func (Minio) String

func (e Minio) String() string

String is the fmt.Stringer interface implementation

type S3

type S3 struct {
	AccessKeyFile string `envconfig:"ACCESS_KEY_FILE" default:"/var/run/secrets/deis/objectstore/creds/accesskey"`
	SecretKeyFile string `envconfig:"SECRET_KEY_FILE" default:"/var/run/secrets/deis/objectstore/creds/secretkey"`
	RegionFile    string `envconfig:"REGION_FILE" default:"/var/run/secrets/deis/objectstore/creds/region"`
	BucketFile    string `envconfig:"BUCKET_FILE" default:"/var/run/secrets/deis/objectstore/creds/bucket"`
}

S3 is the Config implementation for the S3 client

func (S3) CreateDriver

func (s S3) CreateDriver() (driver.StorageDriver, error)

CreateDriver is the Config interface implementation

func (S3) String

func (s S3) String() string

String is the fmt.Stringer interface implementation

type StorageType

type StorageType string

StorageType represents the type of storage that a CLI command should work with

const (
	// S3StorageType is the storage type for Amazon S3. See https://aws.amazon.com/s3/ for more information
	S3StorageType StorageType = "s3"
	// GCSStorageType is the storage type for Google Cloud Storage. See https://cloud.google.com/storage/ for more information
	GCSStorageType StorageType = "gcs"
	// AzureStorageType is the storage type for Azure Blob Storage. See https://azure.microsoft.com/en-us/services/storage/ for more information
	AzureStorageType StorageType = "azure"
	// MinioStorageType is the storage type for Minio. See https://minio.io/ for more information
	MinioStorageType StorageType = "minio"
	// SwiftStorageType is the storage type for swift. See http://docs.openstack.org/developer/swift/ for more information
	SwiftStorageType StorageType = "swift"
)

func StorageTypeFromString

func StorageTypeFromString(s string) (StorageType, error)

StorageTypeFromString attempts to convert s into a StorageType value. Returns ErrUnknownStorageType if s doesn't correspond to any supported storage type

func (StorageType) String

func (c StorageType) String() string

type Swift

type Swift struct {
	UserName      string `envconfig:"USER_NAME_FILE" default:"/var/run/secrets/deis/objectstore/creds/username"`
	Password      string `envconfig:"PASSWORD_FILE" default:"/var/run/secrets/deis/objectstore/creds/password"`
	ContainerFile string `envconfig:"CONTAINER_FILE" default:"/var/run/secrets/deis/objectstore/creds/container"`
	AuthURL       string `envconfig:"AUTHURL_FILE" default:"/var/run/secrets/deis/objectstore/creds/authurl"`
	Tenant        string `envconfig:"TENANT_FILE" default:"/var/run/secrets/deis/objectstore/creds/tenant"`
	AuthVersion   string `envconfig:"AUTH_VERSION_FILE" default:"/var/run/secrets/deis/objectstore/creds/authversion"`
}

Swift is the Config implementation for the Swift client

func (Swift) CreateDriver

func (s Swift) CreateDriver() (driver.StorageDriver, error)

CreateDriver is the Config interface implementation

func (Swift) String

func (s Swift) String() string

Name is the fmt.Stringer interface implementation

Jump to

Keyboard shortcuts

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