postgres

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const BrokerTable = "brokers"
View Source
const PlatformTable = "platforms"
View Source
const ServiceOfferingTable = "service_offerings"
View Source
const ServicePlanTable = "service_plans"
View Source
const Storage = "postgres"
View Source
const VisibilityTable = "visibilities"

Variables

This section is empty.

Functions

This section is empty.

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"`
}

func (*BaseEntity) BuildLabels added in v0.2.0

func (e *BaseEntity) BuildLabels(labels types.Labels, newLabel func(id, key, value string) storage.Label) ([]storage.Label, error)

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"`
	Services    []*ServiceOffering `db:"-"`
}

Broker entity

func (*Broker) FromObject added in v0.2.0

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

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, 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

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 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"`
}

Platform entity

func (*Platform) FromObject added in v0.2.0

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

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, 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

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 PostgresStorage added in v0.2.0

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

func (*PostgresStorage) Close added in v0.2.0

func (ps *PostgresStorage) Close() error

func (*PostgresStorage) Create added in v0.2.0

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

func (*PostgresStorage) Credentials added in v0.2.0

func (ps *PostgresStorage) Credentials() storage.Credentials

func (*PostgresStorage) Delete added in v0.2.0

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

func (*PostgresStorage) Get added in v0.2.0

func (ps *PostgresStorage) Get(ctx context.Context, objectType types.ObjectType, id string) (types.Object, error)

func (*PostgresStorage) InTransaction added in v0.2.0

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

func (*PostgresStorage) Introduce added in v0.2.0

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

func (*PostgresStorage) List added in v0.2.0

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

func (*PostgresStorage) Open added in v0.2.0

func (ps *PostgresStorage) Open(options *storage.Settings) error

func (*PostgresStorage) Ping added in v0.2.0

func (ps *PostgresStorage) Ping() error

func (*PostgresStorage) Security added in v0.2.0

func (ps *PostgresStorage) Security() storage.Security

func (*PostgresStorage) Update added in v0.2.0

func (ps *PostgresStorage) Update(ctx context.Context, obj types.Object, labelChanges ...*query.LabelChange) (types.Object, error)

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

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

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 (sp *ServicePlan) FromObject(object types.Object) (storage.Entity, bool)

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 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, bool)

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

Directories

Path Synopsis
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