postgres

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AND       logicalOperator = "AND"
	INTERSECT logicalOperator = "INTERSECT"
)
View Source
const BrokerPlatformCredentialTable = "broker_platform_credentials"
View Source
const BrokerTable = "brokers"
View Source
const CountLabelValuesQueryTemplate = `` /* 229-byte string literal not displayed */
View Source
const CountQueryTemplate = `` /* 263-byte string literal not displayed */
View Source
const DeleteQueryTemplate = `` /* 388-byte string literal not displayed */
View Source
const NotificationTable = "notifications"
View Source
const OperationTable = "operations"
View Source
const PlatformTable = "platforms"
View Source
const PrimaryKeyColumn = "id"
View Source
const (
	SafeTable = "safe"
)
View Source
const SelectNoLabelsQueryTemplate = `` /* 627-byte string literal not displayed */
View Source
const SelectQueryTemplate = `` /* 1106-byte string literal not displayed */
View Source
const ServiceBindingTable = "service_bindings"
View Source
const ServiceInstanceTable = "service_instances"
View Source
const ServiceOfferingTable = "service_offerings"
View Source
const ServicePlanTable = "service_plans"
View Source
const VisibilityTable = "visibilities"

Variables

View Source
var ErrLockAcquisition = errors.New("failed to acquire lock")
View Source
var ErrUnlockAcquisition = errors.New("failed to unlock")

Functions

func EncryptingLocker added in v0.10.0

func EncryptingLocker(storage *Storage) storage.Locker

EncryptingLocker builds an encrypting storage.Locker with the pre-defined lock index

func NewNotificationStorage added in v0.3.0

func NewNotificationStorage(st storage.Storage) (*notificationStorageImpl, error)

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"`
	Ready          bool      `db:"ready"`
}

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"`
	Integrity             []byte             `db:"integrity"`
	TlsClientKey          string             `db:"tls_client_key"`
	TlsClientCertificate  string             `db:"tls_client_certificate"`
	Catalog               sqlxtypes.JSONText `db:"catalog"`
	SMProvidedCredentials bool               `db:"sm_provided_tls_credentials"`
	Services              []*ServiceOffering `db:"-"`
}

Broker entity

func (*Broker) FromObject added in v0.2.0

func (*Broker) FromObject(object types.Object) (storage.Entity, error)

func (*Broker) LabelEntity added in v0.2.0

func (*Broker) LabelEntity() PostgresLabel

func (*Broker) NewLabel added in v0.2.0

func (e *Broker) NewLabel(id, entityID, key, value string) storage.Label

func (*Broker) RowsToList added in v0.2.0

func (e *Broker) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)

func (*Broker) TableName added in v0.2.0

func (*Broker) TableName() string

func (*Broker) ToObject added in v0.2.0

func (e *Broker) ToObject() (types.Object, error)

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 BrokerPlatformCredential added in v0.11.0

type BrokerPlatformCredential struct {
	BaseEntity

	Username        string `db:"username"`
	PasswordHash    string `db:"password_hash"`
	OldUsername     string `db:"old_username"`
	OldPasswordHash string `db:"old_password_hash"`

	PlatformID string `db:"platform_id"`
	BrokerID   string `db:"broker_id"`

	Integrity []byte `db:"integrity"`

	Active bool `db:"active"`
}

BrokerPlatformCredential entity

func (*BrokerPlatformCredential) FromObject added in v0.11.0

func (*BrokerPlatformCredential) FromObject(object types.Object) (storage.Entity, error)

func (*BrokerPlatformCredential) LabelEntity added in v0.11.0

func (*BrokerPlatformCredential) LabelEntity() PostgresLabel

func (*BrokerPlatformCredential) NewLabel added in v0.11.0

func (e *BrokerPlatformCredential) NewLabel(id, entityID, key, value string) storage.Label

func (*BrokerPlatformCredential) RowsToList added in v0.11.0

func (e *BrokerPlatformCredential) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)

func (*BrokerPlatformCredential) TableName added in v0.11.0

func (*BrokerPlatformCredential) TableName() string

func (*BrokerPlatformCredential) ToObject added in v0.11.0

func (bpc *BrokerPlatformCredential) ToObject() (types.Object, error)

type BrokerPlatformCredentialLabel added in v0.11.0

type BrokerPlatformCredentialLabel struct {
	BaseLabelEntity
	BrokerPlatformCredentialID sql.NullString `db:"broker_platform_credential_id"`
}

func (BrokerPlatformCredentialLabel) LabelsTableName added in v0.11.0

func (el BrokerPlatformCredentialLabel) LabelsTableName() string

func (BrokerPlatformCredentialLabel) ReferenceColumn added in v0.11.0

func (el BrokerPlatformCredentialLabel) 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 Locker added in v0.10.0

type Locker struct {
	*Storage

	AdvisoryIndex int
	// contains filtered or unexported fields
}

func (*Locker) Lock added in v0.10.0

func (l *Locker) Lock(ctx context.Context) error

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 (*Locker) TryLock added in v0.10.0

func (l *Locker) TryLock(ctx context.Context) error

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 (*Locker) Unlock added in v0.10.0

func (l *Locker) Unlock(ctx context.Context) error

Unlock releases the database lock.

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) FromObject(object types.Object) (storage.Entity, error)

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, entityID, 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, error)

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

func NewNotificator(st storage.Storage, settings *storage.Settings) (*Notificator, error)

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

func (n *Notificator) Start(ctx context.Context, group *sync.WaitGroup) error

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"`
	TransitiveResources sqlxtypes.JSONText `db:"transitive_resources"`
	ResourceType        string             `db:"resource_type"`
	PlatformID          string             `db:"platform_id"`
	Errors              sqlxtypes.JSONText `db:"errors"`
	CorrelationID       sql.NullString     `db:"correlation_id"`
	ExternalID          sql.NullString     `db:"external_id"`
	CascadeRootID       sql.NullString     `db:"cascade_root_id"`
	Reschedule          bool               `db:"reschedule"`
	ParentID            sql.NullString     `db:"parent_id"`
	RescheduleTimestamp time.Time          `db:"reschedule_timestamp"`
	DeletionScheduled   time.Time          `db:"deletion_scheduled"`
	Context             sqlxtypes.JSONText `db:"context"`
}

Operation entity

func (*Operation) FromObject added in v0.9.0

func (*Operation) FromObject(object types.Object) (storage.Entity, error)

func (*Operation) LabelEntity added in v0.9.0

func (*Operation) LabelEntity() PostgresLabel

func (*Operation) NewLabel added in v0.9.0

func (e *Operation) NewLabel(id, entityID, key, value string) storage.Label

func (*Operation) RowsToList added in v0.9.0

func (e *Operation) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)

func (*Operation) TableName added in v0.9.0

func (*Operation) TableName() string

func (*Operation) ToObject added in v0.9.0

func (o *Operation) ToObject() (types.Object, error)

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"`
	OldUsername       string         `db:"old_username"`
	Password          string         `db:"password"`
	OldPassword       string         `db:"old_password"`
	Integrity         []byte         `db:"integrity"`
	Active            bool           `db:"active"`
	Suspended         bool           `db:"suspended"`
	CredentialsActive bool           `db:"credentials_active"`
	LastActive        time.Time      `db:"last_active"`
	Technical         bool           `db:"technical"`
	Version           sql.NullString `db:"version"`
}

Platform entity

func (*Platform) FromObject added in v0.2.0

func (p *Platform) FromObject(object types.Object) (storage.Entity, error)

func (*Platform) LabelEntity added in v0.2.0

func (*Platform) LabelEntity() PostgresLabel

func (*Platform) NewLabel added in v0.2.0

func (e *Platform) NewLabel(id, entityID, key, value string) storage.Label

func (*Platform) RowsToList added in v0.2.0

func (e *Platform) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)

func (*Platform) TableName added in v0.2.0

func (*Platform) TableName() string

func (*Platform) ToObject added in v0.2.0

func (p *Platform) ToObject() (types.Object, error)

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 PostgresLabel interface {
	storage.Label
	LabelsTableName() string
	LabelsPrimaryColumn() string
	ReferenceColumn() string
}

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) FromObject added in v0.4.0

func (s *Safe) FromObject(object types.Object) (storage.Entity, error)

func (*Safe) GetID added in v0.4.0

func (s *Safe) GetID() string

func (*Safe) LabelEntity added in v0.4.0

func (s *Safe) LabelEntity() PostgresLabel

func (*Safe) NewLabel added in v0.4.0

func (s *Safe) NewLabel(id, entityID, key, value string) storage.Label

func (*Safe) RowsToList added in v0.4.0

func (s *Safe) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)

func (*Safe) TableName added in v0.4.0

func (s *Safe) TableName() string

func (*Safe) ToObject added in v0.4.0

func (s *Safe) ToObject() (types.Object, error)

type ServiceBinding added in v0.10.0

type ServiceBinding struct {
	BaseEntity
	Name              string                 `db:"name"`
	ServiceInstanceID string                 `db:"service_instance_id"`
	SyslogDrainURL    sql.NullString         `db:"syslog_drain_url"`
	RouteServiceURL   sql.NullString         `db:"route_service_url"`
	VolumeMounts      sqlxtypes.NullJSONText `db:"volume_mounts"`
	Endpoints         sqlxtypes.NullJSONText `db:"endpoints"`
	Context           sqlxtypes.JSONText     `db:"context"`
	BindResource      sqlxtypes.JSONText     `db:"bind_resource"`
	Credentials       string                 `db:"credentials"`
	Integrity         []byte                 `db:"integrity"`
}

ServiceBinding entity

func (*ServiceBinding) FromObject added in v0.10.0

func (*ServiceBinding) FromObject(object types.Object) (storage.Entity, error)

func (*ServiceBinding) LabelEntity added in v0.10.0

func (*ServiceBinding) LabelEntity() PostgresLabel

func (*ServiceBinding) NewLabel added in v0.10.0

func (e *ServiceBinding) NewLabel(id, entityID, key, value string) storage.Label

func (*ServiceBinding) RowsToList added in v0.10.0

func (e *ServiceBinding) RowsToList(rows *sqlx.Rows) (types.ObjectList, error)

func (*ServiceBinding) TableName added in v0.10.0

func (*ServiceBinding) TableName() string

func (*ServiceBinding) ToObject added in v0.10.0

func (sb *ServiceBinding) ToObject() (types.Object, error)

type ServiceBindingLabel added in v0.10.0

type ServiceBindingLabel struct {
	BaseLabelEntity
	ServiceBindingID sql.NullString `db:"service_binding_id"`
}

func (ServiceBindingLabel) LabelsTableName added in v0.10.0

func (el ServiceBindingLabel) LabelsTableName() string

func (ServiceBindingLabel) ReferenceColumn added in v0.10.0

func (el ServiceBindingLabel) ReferenceColumn() string

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"`
	ReferencedInstanceID sql.NullString     `db:"referenced_instance_id"`
	DashboardURL         sql.NullString     `db:"dashboard_url"`
	MaintenanceInfo      sqlxtypes.JSONText `db:"maintenance_info"`
	Context              sqlxtypes.JSONText `db:"context"`
	PreviousValues       sqlxtypes.JSONText `db:"previous_values"`
	UpdateValues         sqlxtypes.JSONText `db:"update_values"`
	Usable               bool               `db:"usable"`
	Shared               sql.NullBool       `db:"shared"`
}

ServiceInstance entity

func (*ServiceInstance) FromObject added in v0.9.0

func (*ServiceInstance) FromObject(object types.Object) (storage.Entity, error)

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, entityID, 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, error)

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"`
	AllowContextUpdates  bool   `db:"allow_context_updates"`
	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) FromObject(object types.Object) (storage.Entity, error)

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, entityID, 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, error)

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      sql.NullBool `db:"bindable"`
	PlanUpdatable sql.NullBool `db:"plan_updateable"`
	CatalogID     string       `db:"catalog_id"`
	CatalogName   string       `db:"catalog_name"`

	Metadata               sqlxtypes.JSONText `db:"metadata"`
	Schemas                sqlxtypes.JSONText `db:"schemas"`
	MaximumPollingDuration int                `db:"maximum_polling_duration"`
	MaintenanceInfo        sqlxtypes.JSONText `db:"maintenance_info"`

	ServiceOfferingID string `db:"service_offering_id"`
}

func (*ServicePlan) FromObject added in v0.2.0

func (sp *ServicePlan) FromObject(object types.Object) (storage.Entity, error)

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, entityID, 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, error)

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) Close added in v0.3.3

func (ps *Storage) Close() error

func (*Storage) Count added in v0.6.0

func (ps *Storage) Count(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (int, error)

func (*Storage) CountLabelValues added in v0.16.9

func (ps *Storage) CountLabelValues(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (int, error)

func (*Storage) Create added in v0.3.3

func (ps *Storage) Create(ctx context.Context, obj types.Object) (types.Object, error)

func (*Storage) Delete added in v0.3.3

func (ps *Storage) Delete(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) error

func (*Storage) DeleteReturning added in v0.9.4

func (ps *Storage) DeleteReturning(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (types.ObjectList, error)

func (*Storage) Get added in v0.3.3

func (ps *Storage) Get(ctx context.Context, objectType types.ObjectType, criteria ...query.Criterion) (types.Object, 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) GetEntities added in v0.15.1

func (ps *Storage) GetEntities() []storage.EntityMetadata

func (*Storage) GetForUpdate added in v0.11.1

func (ps *Storage) GetForUpdate(ctx context.Context, objectType types.ObjectType, criteria ...query.Criterion) (types.Object, error)

func (*Storage) InTransaction added in v0.3.3

func (ps *Storage) InTransaction(ctx context.Context, f func(ctx context.Context, storage storage.Repository) error) error

func (*Storage) Introduce added in v0.3.3

func (ps *Storage) Introduce(entity storage.Entity)

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) ListNoLabels added in v0.11.2

func (ps *Storage) ListNoLabels(ctx context.Context, objType types.ObjectType, criteria ...query.Criterion) (types.ObjectList, error)

func (*Storage) Open added in v0.3.3

func (ps *Storage) Open(settings *storage.Settings) error

func (*Storage) PingContext added in v0.5.0

func (ps *Storage) PingContext(ctx context.Context) error

func (*Storage) QueryForList added in v0.13.5

func (ps *Storage) QueryForList(ctx context.Context, objectType types.ObjectType, queryName storage.NamedQuery, queryParams map[string]interface{}) (types.ObjectList, error)

func (*Storage) SelectContext added in v0.3.3

func (ps *Storage) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error

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

func (*Storage) Update added in v0.3.3

func (ps *Storage) Update(ctx context.Context, obj types.Object, labelChanges types.LabelChanges, _ ...query.Criterion) (types.Object, error)

func (*Storage) UpdateLabels added in v0.11.2

func (ps *Storage) UpdateLabels(ctx context.Context, objectType types.ObjectType, objectID string, labelChanges types.LabelChanges, _ ...query.Criterion) error

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 (v *Visibility) FromObject(visibility types.Object) (storage.Entity, error)

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, entityID, 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, error)

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

Directories

Path Synopsis
notification_connectionfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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