Documentation
¶
Index ¶
- Constants
- func NewNotificationStorage(st storage.Storage) (*notificationStorageImpl, error)
- type BaseEntity
- type BaseLabelEntity
- type Broker
- func (*Broker) FromObject(object types.Object) (storage.Entity, bool)
- func (*Broker) LabelEntity() PostgresLabel
- func (e *Broker) NewLabel(id, key, value string) storage.Label
- func (e *Broker) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*Broker) TableName() string
- func (e *Broker) ToObject() types.Object
- type BrokerLabel
- type EntityLabelRow
- type EntityLabelRowCreator
- type Notification
- func (*Notification) FromObject(object types.Object) (storage.Entity, bool)
- func (*Notification) LabelEntity() PostgresLabel
- func (e *Notification) NewLabel(id, key, value string) storage.Label
- func (e *Notification) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*Notification) TableName() string
- func (n *Notification) ToObject() types.Object
- type NotificationLabel
- type Notificator
- func (n *Notificator) RegisterConsumer(consumer *types.Platform, lastKnownRevision int64) (storage.NotificationQueue, int64, error)
- func (n *Notificator) RegisterFilter(f storage.ReceiversFilterFunc)
- func (n *Notificator) Start(ctx context.Context, group *sync.WaitGroup) error
- func (n *Notificator) UnregisterConsumer(queue storage.NotificationQueue) error
- type Operation
- func (*Operation) FromObject(object types.Object) (storage.Entity, bool)
- func (*Operation) LabelEntity() PostgresLabel
- func (e *Operation) NewLabel(id, key, value string) storage.Label
- func (e *Operation) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*Operation) TableName() string
- func (o *Operation) ToObject() types.Object
- type OperationLabel
- type Platform
- func (p *Platform) FromObject(object types.Object) (storage.Entity, bool)
- func (*Platform) LabelEntity() PostgresLabel
- func (e *Platform) NewLabel(id, key, value string) storage.Label
- func (e *Platform) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*Platform) TableName() string
- func (p *Platform) ToObject() types.Object
- type PlatformLabel
- type PostgresEntity
- type PostgresLabel
- type QueryBuilder
- type Safe
- func (s *Safe) BuildLabels(labels types.Labels, newLabel func(id, key, value string) storage.Label) ([]storage.Label, error)
- func (s *Safe) FromObject(object types.Object) (storage.Entity, bool)
- func (s *Safe) GetID() string
- func (s *Safe) LabelEntity() PostgresLabel
- func (s *Safe) NewLabel(id, key, value string) storage.Label
- func (s *Safe) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (s *Safe) TableName() string
- func (s *Safe) ToObject() types.Object
- type ServiceInstance
- func (*ServiceInstance) FromObject(object types.Object) (storage.Entity, bool)
- func (*ServiceInstance) LabelEntity() PostgresLabel
- func (e *ServiceInstance) NewLabel(id, key, value string) storage.Label
- func (e *ServiceInstance) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*ServiceInstance) TableName() string
- func (si *ServiceInstance) ToObject() types.Object
- type ServiceInstanceLabel
- type ServiceOffering
- func (*ServiceOffering) FromObject(object types.Object) (storage.Entity, bool)
- func (*ServiceOffering) LabelEntity() PostgresLabel
- func (e *ServiceOffering) NewLabel(id, key, value string) storage.Label
- func (e *ServiceOffering) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*ServiceOffering) TableName() string
- func (e *ServiceOffering) ToObject() types.Object
- type ServiceOfferingLabel
- type ServicePlan
- func (sp *ServicePlan) FromObject(object types.Object) (storage.Entity, bool)
- func (*ServicePlan) LabelEntity() PostgresLabel
- func (e *ServicePlan) NewLabel(id, key, value string) storage.Label
- func (e *ServicePlan) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*ServicePlan) TableName() string
- func (sp *ServicePlan) ToObject() types.Object
- type ServicePlanLabel
- type Storage
- func (ps *Storage) Close() error
- func (ps *Storage) Count(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (int, error)
- func (ps *Storage) Create(ctx context.Context, obj types.Object) (types.Object, error)
- func (ps *Storage) Delete(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (types.ObjectList, error)
- func (ps *Storage) Get(ctx context.Context, objectType types.ObjectType, criteria ...query.Criterion) (types.Object, error)
- func (s *Storage) GetEncryptionKey(ctx context.Context, ...) ([]byte, error)
- func (ps *Storage) InTransaction(ctx context.Context, ...) error
- func (ps *Storage) Introduce(entity storage.Entity)
- func (ps *Storage) List(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (types.ObjectList, error)
- func (s *Storage) Lock(ctx context.Context) error
- func (ps *Storage) Open(settings *storage.Settings) error
- func (ps *Storage) PingContext(ctx context.Context) error
- func (ps *Storage) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (s *Storage) SetEncryptionKey(ctx context.Context, key []byte, ...) error
- func (s *Storage) Unlock(ctx context.Context) error
- func (ps *Storage) Update(ctx context.Context, obj types.Object, labelChanges query.LabelChanges, ...) (types.Object, error)
- type Visibility
- func (v *Visibility) FromObject(visibility types.Object) (storage.Entity, bool)
- func (*Visibility) LabelEntity() PostgresLabel
- func (e *Visibility) NewLabel(id, key, value string) storage.Label
- func (e *Visibility) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
- func (*Visibility) TableName() string
- func (v *Visibility) ToObject() types.Object
- type VisibilityLabel
Constants ¶
const ( AND logicalOperator = "AND" OR logicalOperator = "OR" )
const BrokerTable = "brokers"
const CountQueryTemplate = `` /* 262-byte string literal not displayed */
const DeleteQueryTemplate = `` /* 388-byte string literal not displayed */
const NotificationTable = "notifications"
const OperationTable = "operations"
const PlatformTable = "platforms"
const PrimaryKeyColumn = "id"
const (
SafeTable = "safe"
)
const SelectQueryTemplate = `` /* 1105-byte string literal not displayed */
const ServiceInstanceTable = "service_instances"
const ServiceOfferingTable = "service_offerings"
const ServicePlanTable = "service_plans"
const VisibilityTable = "visibilities"
Variables ¶
This section is empty.
Functions ¶
func NewNotificationStorage ¶ added in v0.3.0
NewNotificationStorage returns new notification storage
Types ¶
type BaseEntity ¶ added in v0.2.0
type BaseEntity struct {
ID string `db:"id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
PagingSequence int64 `db:"paging_sequence,auto_increment"`
}
func (*BaseEntity) BuildLabels ¶ added in v0.2.0
func (*BaseEntity) GetID ¶ added in v0.2.0
func (e *BaseEntity) GetID() string
type BaseLabelEntity ¶ added in v0.2.0
type BaseLabelEntity struct {
ID sql.NullString `db:"id"`
Key sql.NullString `db:"key"`
Val sql.NullString `db:"val"`
CreatedAt pq.NullTime `db:"created_at"`
UpdatedAt pq.NullTime `db:"updated_at"`
}
func (BaseLabelEntity) GetKey ¶ added in v0.2.0
func (el BaseLabelEntity) GetKey() string
func (BaseLabelEntity) GetValue ¶ added in v0.2.0
func (el BaseLabelEntity) GetValue() string
func (BaseLabelEntity) LabelsPrimaryColumn ¶ added in v0.2.0
func (el BaseLabelEntity) LabelsPrimaryColumn() string
type Broker ¶
type Broker struct {
BaseEntity
Name string `db:"name"`
Description sql.NullString `db:"description"`
BrokerURL string `db:"broker_url"`
Username string `db:"username"`
Password string `db:"password"`
Catalog sqlxtypes.JSONText `db:"catalog"`
Services []*ServiceOffering `db:"-"`
}
Broker entity
func (*Broker) FromObject ¶ added in v0.2.0
func (*Broker) LabelEntity ¶ added in v0.2.0
func (*Broker) LabelEntity() PostgresLabel
func (*Broker) RowsToList ¶ added in v0.2.0
type BrokerLabel ¶ added in v0.1.8
type BrokerLabel struct {
BaseLabelEntity
BrokerID sql.NullString `db:"broker_id"`
}
func (BrokerLabel) LabelsTableName ¶ added in v0.2.0
func (el BrokerLabel) LabelsTableName() string
func (BrokerLabel) ReferenceColumn ¶ added in v0.2.0
func (el BrokerLabel) ReferenceColumn() string
type EntityLabelRow ¶ added in v0.2.0
type EntityLabelRow interface {
PostgresEntity
PostgresLabel
}
type EntityLabelRowCreator ¶ added in v0.2.0
type EntityLabelRowCreator func() EntityLabelRow
type Notification ¶ added in v0.3.0
type Notification struct {
BaseEntity
Resource string `db:"resource"`
Type string `db:"type"`
PlatformID sql.NullString `db:"platform_id"`
Revision int64 `db:"revision,auto_increment"`
Payload sqlxtypes.JSONText `db:"payload"`
CorrelationID sql.NullString `db:"correlation_id"`
}
Notification entity
func (*Notification) FromObject ¶ added in v0.3.0
func (*Notification) LabelEntity ¶ added in v0.3.0
func (*Notification) LabelEntity() PostgresLabel
func (*Notification) NewLabel ¶ added in v0.3.0
func (e *Notification) NewLabel(id, key, value string) storage.Label
func (*Notification) RowsToList ¶ added in v0.3.0
func (e *Notification) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
func (*Notification) TableName ¶ added in v0.3.0
func (*Notification) TableName() string
func (*Notification) ToObject ¶ added in v0.3.0
func (n *Notification) ToObject() types.Object
type NotificationLabel ¶ added in v0.3.0
type NotificationLabel struct {
BaseLabelEntity
NotificationID sql.NullString `db:"notification_id"`
}
func (NotificationLabel) LabelsTableName ¶ added in v0.3.0
func (el NotificationLabel) LabelsTableName() string
func (NotificationLabel) ReferenceColumn ¶ added in v0.3.0
func (el NotificationLabel) ReferenceColumn() string
type Notificator ¶ added in v0.3.0
type Notificator struct {
// contains filtered or unexported fields
}
func NewNotificator ¶ added in v0.3.0
NewNotificator returns new Notificator based on a given NotificatorStorage and desired queue size
func (*Notificator) RegisterConsumer ¶ added in v0.3.0
func (n *Notificator) RegisterConsumer(consumer *types.Platform, lastKnownRevision int64) (storage.NotificationQueue, int64, error)
func (*Notificator) RegisterFilter ¶ added in v0.3.3
func (n *Notificator) RegisterFilter(f storage.ReceiversFilterFunc)
RegisterFilter adds new notification filter. It must not be called concurrently.
func (*Notificator) Start ¶ added in v0.3.0
Start starts the Notificator. It must not be called concurrently.
func (*Notificator) UnregisterConsumer ¶ added in v0.3.0
func (n *Notificator) UnregisterConsumer(queue storage.NotificationQueue) error
type Operation ¶ added in v0.9.0
type Operation struct {
BaseEntity
Description sql.NullString `db:"description"`
Type string `db:"type"`
State string `db:"state"`
ResourceID string `db:"resource_id"`
ResourceType string `db:"resource_type"`
Errors sqlxtypes.JSONText `db:"errors"`
CorrelationID sql.NullString `db:"correlation_id"`
ExternalID sql.NullString `db:"external_id"`
}
Operation entity
func (*Operation) FromObject ¶ added in v0.9.0
func (*Operation) LabelEntity ¶ added in v0.9.0
func (*Operation) LabelEntity() PostgresLabel
func (*Operation) RowsToList ¶ added in v0.9.0
type OperationLabel ¶ added in v0.9.0
type OperationLabel struct {
BaseLabelEntity
OperationID sql.NullString `db:"operation_id"`
}
func (OperationLabel) LabelsTableName ¶ added in v0.9.0
func (el OperationLabel) LabelsTableName() string
func (OperationLabel) ReferenceColumn ¶ added in v0.9.0
func (el OperationLabel) ReferenceColumn() string
type Platform ¶
type Platform struct {
BaseEntity
Type string `db:"type"`
Name string `db:"name"`
Description sql.NullString `db:"description"`
Username string `db:"username"`
Password string `db:"password"`
Active bool `db:"active"`
LastActive time.Time `db:"last_active"`
}
Platform entity
func (*Platform) FromObject ¶ added in v0.2.0
func (*Platform) LabelEntity ¶ added in v0.2.0
func (*Platform) LabelEntity() PostgresLabel
func (*Platform) RowsToList ¶ added in v0.2.0
type PlatformLabel ¶ added in v0.2.0
type PlatformLabel struct {
BaseLabelEntity
PlatformID sql.NullString `db:"platform_id"`
}
func (PlatformLabel) LabelsTableName ¶ added in v0.2.0
func (el PlatformLabel) LabelsTableName() string
func (PlatformLabel) ReferenceColumn ¶ added in v0.2.0
func (el PlatformLabel) ReferenceColumn() string
type PostgresEntity ¶ added in v0.2.0
type PostgresEntity interface {
storage.Entity
TableName() string
RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
LabelEntity() PostgresLabel
}
type PostgresLabel ¶ added in v0.2.0
type QueryBuilder ¶ added in v0.4.0
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder is used to construct new queries. It is safe for concurrent usage
func NewQueryBuilder ¶ added in v0.4.0
func NewQueryBuilder(db pgDB) *QueryBuilder
NewQueryBuilder constructs new query builder for the current db
func (*QueryBuilder) NewQuery ¶ added in v0.4.0
func (qb *QueryBuilder) NewQuery(entity PostgresEntity) *pgQuery
NewQuery constructs new queries for the current query builder db
type Safe ¶
type Safe struct {
Secret []byte `db:"secret"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
Safe represents a secret entity
func (*Safe) BuildLabels ¶ added in v0.4.0
func (*Safe) FromObject ¶ added in v0.4.0
func (*Safe) LabelEntity ¶ added in v0.4.0
func (s *Safe) LabelEntity() PostgresLabel
func (*Safe) RowsToList ¶ added in v0.4.0
type ServiceInstance ¶ added in v0.9.0
type ServiceInstance struct {
BaseEntity
Name string `db:"name"`
ServicePlanID string `db:"service_plan_id"`
PlatformID string `db:"platform_id"`
MaintenanceInfo sqlxtypes.JSONText `db:"maintenance_info"`
Context sqlxtypes.JSONText `db:"context"`
PreviousValues sqlxtypes.JSONText `db:"previous_values"`
Usable bool `db:"usable"`
Ready bool `db:"ready"`
}
ServiceInstance entity
func (*ServiceInstance) FromObject ¶ added in v0.9.0
func (*ServiceInstance) LabelEntity ¶ added in v0.9.0
func (*ServiceInstance) LabelEntity() PostgresLabel
func (*ServiceInstance) NewLabel ¶ added in v0.9.0
func (e *ServiceInstance) NewLabel(id, key, value string) storage.Label
func (*ServiceInstance) RowsToList ¶ added in v0.9.0
func (e *ServiceInstance) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
func (*ServiceInstance) TableName ¶ added in v0.9.0
func (*ServiceInstance) TableName() string
func (*ServiceInstance) ToObject ¶ added in v0.9.0
func (si *ServiceInstance) ToObject() types.Object
type ServiceInstanceLabel ¶ added in v0.9.0
type ServiceInstanceLabel struct {
BaseLabelEntity
ServiceInstanceID sql.NullString `db:"service_instance_id"`
}
func (ServiceInstanceLabel) LabelsTableName ¶ added in v0.9.0
func (el ServiceInstanceLabel) LabelsTableName() string
func (ServiceInstanceLabel) ReferenceColumn ¶ added in v0.9.0
func (el ServiceInstanceLabel) ReferenceColumn() string
type ServiceOffering ¶ added in v0.1.2
type ServiceOffering struct {
BaseEntity
Name string `db:"name"`
Description string `db:"description"`
Bindable bool `db:"bindable"`
InstancesRetrievable bool `db:"instances_retrievable"`
BindingsRetrievable bool `db:"bindings_retrievable"`
PlanUpdatable bool `db:"plan_updateable"`
CatalogID string `db:"catalog_id"`
CatalogName string `db:"catalog_name"`
Tags sqlxtypes.JSONText `db:"tags"`
Requires sqlxtypes.JSONText `db:"requires"`
Metadata sqlxtypes.JSONText `db:"metadata"`
BrokerID string `db:"broker_id"`
Plans []*ServicePlan `db:"-"`
}
func (*ServiceOffering) FromObject ¶ added in v0.2.0
func (*ServiceOffering) LabelEntity ¶ added in v0.2.0
func (*ServiceOffering) LabelEntity() PostgresLabel
func (*ServiceOffering) NewLabel ¶ added in v0.2.0
func (e *ServiceOffering) NewLabel(id, key, value string) storage.Label
func (*ServiceOffering) RowsToList ¶ added in v0.2.0
func (e *ServiceOffering) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
func (*ServiceOffering) TableName ¶ added in v0.2.0
func (*ServiceOffering) TableName() string
func (*ServiceOffering) ToObject ¶ added in v0.2.0
func (e *ServiceOffering) ToObject() types.Object
type ServiceOfferingLabel ¶ added in v0.2.0
type ServiceOfferingLabel struct {
BaseLabelEntity
ServiceOfferingID sql.NullString `db:"service_offering_id"`
}
func (ServiceOfferingLabel) LabelsTableName ¶ added in v0.2.0
func (el ServiceOfferingLabel) LabelsTableName() string
func (ServiceOfferingLabel) ReferenceColumn ¶ added in v0.2.0
func (el ServiceOfferingLabel) ReferenceColumn() string
type ServicePlan ¶ added in v0.1.2
type ServicePlan struct {
BaseEntity
Name string `db:"name"`
Description string `db:"description"`
Free bool `db:"free"`
Bindable bool `db:"bindable"`
PlanUpdatable bool `db:"plan_updateable"`
CatalogID string `db:"catalog_id"`
CatalogName string `db:"catalog_name"`
Metadata sqlxtypes.JSONText `db:"metadata"`
Schemas sqlxtypes.JSONText `db:"schemas"`
ServiceOfferingID string `db:"service_offering_id"`
}
func (*ServicePlan) FromObject ¶ added in v0.2.0
func (*ServicePlan) LabelEntity ¶ added in v0.2.0
func (*ServicePlan) LabelEntity() PostgresLabel
func (*ServicePlan) NewLabel ¶ added in v0.2.0
func (e *ServicePlan) NewLabel(id, key, value string) storage.Label
func (*ServicePlan) RowsToList ¶ added in v0.2.0
func (e *ServicePlan) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
func (*ServicePlan) TableName ¶ added in v0.2.0
func (*ServicePlan) TableName() string
func (*ServicePlan) ToObject ¶ added in v0.2.0
func (sp *ServicePlan) ToObject() types.Object
type ServicePlanLabel ¶ added in v0.2.0
type ServicePlanLabel struct {
BaseLabelEntity
ServicePlanID sql.NullString `db:"service_plan_id"`
}
func (ServicePlanLabel) LabelsTableName ¶ added in v0.2.0
func (el ServicePlanLabel) LabelsTableName() string
func (ServicePlanLabel) ReferenceColumn ¶ added in v0.2.0
func (el ServicePlanLabel) ReferenceColumn() string
type Storage ¶
type Storage struct {
ConnectFunc func(driver string, url string) (*sql.DB, error)
// contains filtered or unexported fields
}
func (*Storage) Delete ¶ added in v0.3.3
func (ps *Storage) Delete(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (types.ObjectList, error)
func (*Storage) GetEncryptionKey ¶ added in v0.3.3
func (s *Storage) GetEncryptionKey(ctx context.Context, transformationFunc func(context.Context, []byte, []byte) ([]byte, error)) ([]byte, error)
GetEncryptionKey returns the encryption key used to encrypt the credentials for brokers
func (*Storage) InTransaction ¶ added in v0.3.3
func (*Storage) List ¶ added in v0.3.3
func (ps *Storage) List(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (types.ObjectList, error)
func (*Storage) Lock ¶ added in v0.3.3
Lock acquires a database lock so that only one process can manipulate the encryption key. Returns an error if the process has already acquired the lock
func (*Storage) PingContext ¶ added in v0.5.0
func (*Storage) SelectContext ¶ added in v0.3.3
func (*Storage) SetEncryptionKey ¶ added in v0.3.3
func (s *Storage) SetEncryptionKey(ctx context.Context, key []byte, transformationFunc func(context.Context, []byte, []byte) ([]byte, error)) error
SetEncryptionKey Sets the encryption key by encrypting it beforehand with the encryption key in the environment
type Visibility ¶ added in v0.1.6
type Visibility struct {
BaseEntity
PlatformID sql.NullString `db:"platform_id"`
ServicePlanID string `db:"service_plan_id"`
}
func (*Visibility) FromObject ¶ added in v0.2.0
func (*Visibility) LabelEntity ¶ added in v0.2.0
func (*Visibility) LabelEntity() PostgresLabel
func (*Visibility) NewLabel ¶ added in v0.2.0
func (e *Visibility) NewLabel(id, key, value string) storage.Label
func (*Visibility) RowsToList ¶ added in v0.2.0
func (e *Visibility) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)
func (*Visibility) TableName ¶ added in v0.2.0
func (*Visibility) TableName() string
func (*Visibility) ToObject ¶ added in v0.2.0
func (v *Visibility) ToObject() types.Object
type VisibilityLabel ¶ added in v0.1.8
type VisibilityLabel struct {
BaseLabelEntity
VisibilityID sql.NullString `db:"visibility_id"`
}
func (VisibilityLabel) LabelsTableName ¶ added in v0.2.0
func (el VisibilityLabel) LabelsTableName() string
func (VisibilityLabel) ReferenceColumn ¶ added in v0.2.0
func (el VisibilityLabel) ReferenceColumn() string
Source Files
¶
- abstract.go
- base_entity.go
- broker.go
- broker_gen.go
- interfaces.go
- keystore.go
- labels.go
- notification.go
- notification_connection.go
- notification_gen.go
- notification_storage.go
- notificator.go
- operation.go
- operation_gen.go
- platform.go
- platform_gen.go
- query_builder.go
- scheme.go
- service_instance.go
- service_offering.go
- service_plan.go
- serviceinstance_gen.go
- serviceoffering_gen.go
- serviceplan_gen.go
- storage.go
- storage_state.go
- visibility.go
- visibility_gen.go
- where_clause_tree.go
Directories
¶
| Path | Synopsis |
|---|---|
|
notification_connectionfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |