Documentation ¶
Index ¶
- func IsActiveOperationInProgressError(err error) bool
- func IsAlreadyExistsError(err error) bool
- func IsNotFoundError(err error) bool
- type Addon
- type BindOperation
- type Chart
- type Config
- type ConfigList
- type DriverType
- type EntityName
- type Factory
- type Instance
- type InstanceBindData
- type InstanceOperation
- type ProviderConfig
- type ProviderConfigMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsActiveOperationInProgressError ¶
IsActiveOperationInProgressError checks if given error is ActiveOperationInProgress error
func IsAlreadyExistsError ¶
IsAlreadyExistsError checks if given error is AlreadyExist error
func IsNotFoundError ¶
IsNotFoundError checks if given error is NotFound error
Types ¶
type Addon ¶
type Addon interface { Upsert(internal.Namespace, *internal.Addon) (replace bool, err error) Get(internal.Namespace, internal.AddonName, semver.Version) (*internal.Addon, error) GetByID(internal.Namespace, internal.AddonID) (*internal.Addon, error) Remove(internal.Namespace, internal.AddonName, semver.Version) error RemoveByID(internal.Namespace, internal.AddonID) error RemoveAll(internal.Namespace) error FindAll(internal.Namespace) ([]*internal.Addon, error) }
Addon is an interface that describe storage layer operations for Addons
type BindOperation ¶ added in v1.1.0
type BindOperation interface { Insert(*internal.BindOperation) error Get(internal.InstanceID, internal.BindingID, internal.OperationID) (*internal.BindOperation, error) GetAll(internal.InstanceID) ([]*internal.BindOperation, error) UpdateState(internal.InstanceID, internal.BindingID, internal.OperationID, internal.OperationState) error UpdateStateDesc(internal.InstanceID, internal.BindingID, internal.OperationID, internal.OperationState, *string) error Remove(internal.InstanceID, internal.BindingID, internal.OperationID) error }
BindOperation is an interface that describe storage layer operations for BindOperations
type Chart ¶
type Chart interface { Upsert(internal.Namespace, *chart.Chart) (replace bool, err error) Get(internal.Namespace, internal.ChartName, semver.Version) (*chart.Chart, error) Remove(internal.Namespace, internal.ChartName, semver.Version) error }
Chart is an interface that describe storage layer operations for Charts
type Config ¶
type Config struct { Driver DriverType `json:"driver" valid:"required"` Provide ProviderConfigMap `json:"provide" valid:"required"` Etcd etcd.Config `json:"etcd"` Memory memory.Config `json:"memory"` }
Config contains database configuration.
type ConfigList ¶
type ConfigList []Config
ConfigList is a list of configurations
func ConfigParse ¶
func ConfigParse(inByte []byte) (*ConfigList, error)
ConfigParse is parsing yaml file to the ConfigList
func NewConfigListAllMemory ¶
func NewConfigListAllMemory() *ConfigList
NewConfigListAllMemory returns configured configList with the memory driver for all entities.
func (*ConfigList) ExtractEtcdURL ¶
func (cl *ConfigList) ExtractEtcdURL() string
ExtractEtcdURL extracts URL to the ETCD from config
func (*ConfigList) WaitForEtcdReadiness ¶ added in v1.1.0
func (cl *ConfigList) WaitForEtcdReadiness() error
WaitForEtcdReadiness waits for ETCD to be ready
type DriverType ¶
type DriverType string
DriverType defines type of data storage
const ( // DriverEtcd is a driver for key-value store - Etcd DriverEtcd DriverType = "etcd" // DriverMemory is a driver to local in-memory store DriverMemory DriverType = "memory" )
type EntityName ¶
type EntityName string
EntityName defines name of the entity in database
const ( // EntityAll represents name of all entities EntityAll EntityName = "all" // EntityChart represents name of chart entities EntityChart EntityName = "chart" // EntityAddon represents name of addon entities EntityAddon EntityName = "addon" // EntityInstance represents name of services instances entities EntityInstance EntityName = "instance" // EntityInstanceOperation represents name of instances operations entities EntityInstanceOperation EntityName = "instanceOperation" // EntityInstanceBindData represents name of bind data entities EntityInstanceBindData EntityName = "entityInstanceBindData" // EntityBindOperation represents name of bind operations entities EntityBindOperation EntityName = "bindOperation" )
type Factory ¶
type Factory interface { Addon() Addon Chart() Chart Instance() Instance InstanceOperation() InstanceOperation InstanceBindData() InstanceBindData BindOperation() BindOperation }
Factory provides access to concrete storage. Multiple calls should to specific storage return the same storage instance.
func NewFactory ¶
func NewFactory(cl *ConfigList) (Factory, error)
NewFactory is a factory for entities based on given ConfigList TODO: add error handling
type Instance ¶
type Instance interface { Insert(*internal.Instance) error Upsert(*internal.Instance) (replace bool, err error) Get(internal.InstanceID) (*internal.Instance, error) GetAll() ([]*internal.Instance, error) Remove(internal.InstanceID) error }
Instance is an interface that describe storage layer operations for Instances
type InstanceBindData ¶
type InstanceBindData interface { Insert(*internal.InstanceBindData) error Get(internal.InstanceID) (*internal.InstanceBindData, error) Remove(internal.InstanceID) error }
InstanceBindData is an interface that describe storage layer operations for InstanceBindData entities
type InstanceOperation ¶
type InstanceOperation interface { // Insert is inserting object into storage. // Object is modified by setting CreatedAt. Insert(*internal.InstanceOperation) error Get(internal.InstanceID, internal.OperationID) (*internal.InstanceOperation, error) GetAll(internal.InstanceID) ([]*internal.InstanceOperation, error) UpdateState(internal.InstanceID, internal.OperationID, internal.OperationState) error UpdateStateDesc(internal.InstanceID, internal.OperationID, internal.OperationState, *string) error Remove(internal.InstanceID, internal.OperationID) error }
InstanceOperation is an interface that describe storage layer operations for InstanceOperations
type ProviderConfig ¶
type ProviderConfig struct{}
ProviderConfig provides configuration to the database provider
type ProviderConfigMap ¶
type ProviderConfigMap map[EntityName]ProviderConfig
ProviderConfigMap contains map of provided configurations for given entities