Documentation ¶
Index ¶
- Constants
- func CloseDatabase(t *testing.T, connection *dbr.Connection)
- func EnsureTestNetworkForDB(t *testing.T, ctx context.Context) (func(), error)
- func InitTestDBTables(t *testing.T, connectionURL string) error
- type BrokerStorage
- type Config
- type Deprovisioning
- type Instances
- type LMSTenants
- type Operations
- type Provisioning
Constants ¶
View Source
const ( DbUser = "admin" DbPass = "nimda" DbName = "broker" DbPort = "5432" DockerUserNetwork = "test_network" EnvPipelineBuild = "PIPELINE_BUILD" )
Variables ¶
This section is empty.
Functions ¶
func CloseDatabase ¶
func CloseDatabase(t *testing.T, connection *dbr.Connection)
func EnsureTestNetworkForDB ¶
Types ¶
type BrokerStorage ¶
type BrokerStorage interface { Instances() Instances Operations() Operations Provisioning() Provisioning Deprovisioning() Deprovisioning LMSTenants() LMSTenants }
func NewFromConfig ¶
func NewFromConfig(cfg Config, log logrus.FieldLogger) (BrokerStorage, *dbr.Connection, error)
func NewMemoryStorage ¶
func NewMemoryStorage() BrokerStorage
type Config ¶
type Config struct { User string `envconfig:"default=postgres"` Password string `envconfig:"default=password"` Host string `envconfig:"default=localhost"` Port string `envconfig:"default=5432"` Name string `envconfig:"default=broker"` SSLMode string `envconfig:"default=disable"` MaxOpenConns int `envconfig:"default=8"` MaxIdleConns int `envconfig:"default=2"` ConnMaxLifetime time.Duration `envconfig:"default=30m"` }
func InitTestDBContainer ¶
func (*Config) ConnectionURL ¶
type Deprovisioning ¶
type Deprovisioning interface { InsertDeprovisioningOperation(operation internal.DeprovisioningOperation) error GetDeprovisioningOperationByID(operationID string) (*internal.DeprovisioningOperation, error) GetDeprovisioningOperationByInstanceID(instanceID string) (*internal.DeprovisioningOperation, error) UpdateDeprovisioningOperation(operation internal.DeprovisioningOperation) (*internal.DeprovisioningOperation, error) }
type Instances ¶
type Instances interface { FindAllJoinedWithOperations(prct ...predicate.Predicate) ([]internal.InstanceWithOperation, error) FindAllInstancesForRuntimes(runtimeIdList []string) ([]internal.Instance, error) GetByID(instanceID string) (*internal.Instance, error) Insert(instance internal.Instance) error Update(instance internal.Instance) error Delete(instanceID string) error GetInstanceStats() (internal.InstanceStats, error) }
type LMSTenants ¶
type Operations ¶
type Operations interface { Provisioning Deprovisioning GetOperationByID(operationID string) (*internal.Operation, error) GetOperationsInProgressByType(operationType dbmodel.OperationType) ([]internal.Operation, error) GetOperationStats() (internal.OperationStats, error) }
type Provisioning ¶
type Provisioning interface { InsertProvisioningOperation(operation internal.ProvisioningOperation) error GetProvisioningOperationByID(operationID string) (*internal.ProvisioningOperation, error) GetProvisioningOperationByInstanceID(instanceID string) (*internal.ProvisioningOperation, error) UpdateProvisioningOperation(operation internal.ProvisioningOperation) (*internal.ProvisioningOperation, error) }
Click to show internal directories.
Click to hide internal directories.