models

package
v5.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 3 Imported by: 23

Documentation

Index

Constants

View Source
const (
	// The following operation types are used as part of the OSB process.
	// The types correspond to asynchronous provision/deprovision/update calls
	// and will exist on a ServiceInstanceDetails with an operation ID that can be
	// used to look up the state of an operation.
	ProvisionOperationType   = "provision"
	DeprovisionOperationType = "deprovision"
	UpdateOperationType      = "update"
	ClearOperationType       = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudOperation

type CloudOperation CloudOperationV1

CloudOperation holds information about the status of Google Cloud long-running operations.

type CloudOperationV1

type CloudOperationV1 struct {
	gorm.Model

	Name          string
	Status        string
	OperationType string
	ErrorMessage  string `gorm:"type:text"`
	InsertTime    string
	StartTime     string
	TargetId      string
	TargetLink    string

	ServiceId         string
	ServiceInstanceId string
}

CloudOperationV1 holds information about the status of Google Cloud long-running operations. As-of version 4.1.0, this table is no longer necessary.

func (CloudOperationV1) TableName

func (CloudOperationV1) TableName() string

TableName returns a consistent table name (`cloud_operations`) for gorm so multiple structs from different versions of the database all operate on the same table.

type Migration

type Migration MigrationV1

Migration represents the mgirations table. It holds a monotonically increasing number that gets incremented with every database schema revision.

type MigrationV1

type MigrationV1 struct {
	gorm.Model

	MigrationId int `gorm:"type:int(10)"`
}

MigrationV1 represents the mgirations table. It holds a monotonically increasing number that gets incremented with every database schema revision.

func (MigrationV1) TableName

func (MigrationV1) TableName() string

TableName returns a consistent table name (`migrations`) for gorm so multiple structs from different versions of the database all operate on the same table.

type PlanDetailsV1

type PlanDetailsV1 struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	ServiceId string
	Name      string
	Features  string `sql:"type:text"`
}

PlanDetailsV1 is a table that was deprecated in favor of using Environment variables. It only remains for ORM migrations and the ability for existing users to export their plans.

func (PlanDetailsV1) TableName

func (PlanDetailsV1) TableName() string

TableName returns a consistent table name (`plan_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ProvisionRequestDetails

type ProvisionRequestDetails ProvisionRequestDetailsV1

ProvisionRequestDetails holds user-defined properties passed to a call to provision a service.

type ProvisionRequestDetailsV1

type ProvisionRequestDetailsV1 struct {
	gorm.Model

	ServiceInstanceId string
	// is a json.Marshal of models.ProvisionDetails
	RequestDetails string
}

ProvisionRequestDetailsV1 holds user-defined properties passed to a call to provision a service.

func (ProvisionRequestDetailsV1) TableName

func (ProvisionRequestDetailsV1) TableName() string

TableName returns a consistent table name (`provision_request_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ProvisionRequestDetailsV2

type ProvisionRequestDetailsV2 struct {
	gorm.Model

	ServiceInstanceId string

	// is a json.Marshal of models.ProvisionDetails
	RequestDetails string `gorm:"type:text"`
}

ProvisionRequestDetailsV2 holds user-defined properties passed to a call to provision a service.

func (ProvisionRequestDetailsV2) TableName

func (ProvisionRequestDetailsV2) TableName() string

TableName returns a consistent table name (`provision_request_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ServiceBindingCredentials

type ServiceBindingCredentials ServiceBindingCredentialsV1

ServiceBindingCredentials holds credentials returned to the users after binding to a service.

type ServiceBindingCredentialsV1

type ServiceBindingCredentialsV1 struct {
	gorm.Model

	OtherDetails string `gorm:"type:text"`

	ServiceId         string
	ServiceInstanceId string
	BindingId         string
}

ServiceBindingCredentialsV1 holds credentials returned to the users after binding to a service.

func (ServiceBindingCredentialsV1) TableName

func (ServiceBindingCredentialsV1) TableName() string

TableName returns a consistent table name (`service_binding_credentials`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ServiceInstanceDetails

type ServiceInstanceDetails ServiceInstanceDetailsV2

ServiceInstanceDetails holds information about provisioned services.

func (ServiceInstanceDetails) GetOtherDetails

func (si ServiceInstanceDetails) GetOtherDetails(v interface{}) error

GetOtherDetails returns an unmarshalls the OtherDetails field into the given struct. An empty OtherDetails field does not get unmarshalled and does not error.

func (*ServiceInstanceDetails) SetOtherDetails

func (si *ServiceInstanceDetails) SetOtherDetails(toSet interface{}) error

SetOtherDetails marshals the value passed in into a JSON string and sets OtherDetails to it if marshalling was successful.

type ServiceInstanceDetailsV1

type ServiceInstanceDetailsV1 struct {
	ID        string `gorm:"primary_key;type:varchar(255);not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	Name         string
	Location     string
	Url          string
	OtherDetails string `gorm:"type:text"`

	ServiceId        string
	PlanId           string
	SpaceGuid        string
	OrganizationGuid string
}

ServiceInstanceDetailsV1 holds information about provisioned services.

func (ServiceInstanceDetailsV1) TableName

func (ServiceInstanceDetailsV1) TableName() string

TableName returns a consistent table name (`service_instance_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type ServiceInstanceDetailsV2

type ServiceInstanceDetailsV2 struct {
	ID        string `gorm:"primary_key;type:varchar(255);not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	Name         string
	Location     string
	Url          string
	OtherDetails string `gorm:"type:text"`

	ServiceId        string
	PlanId           string
	SpaceGuid        string
	OrganizationGuid string

	// OperationType holds a string corresponding to what kind of operation
	// OperationId is referencing. The object is "locked" for editing if
	// an operation is pending.
	OperationType string

	// OperationId holds a string referencing an operation specific to a broker.
	// Operations in GCP all have a unique ID.
	// The OperationId will be cleared after a successful operation.
	// This string MAY be sent to users and MUST NOT leak confidential information.
	OperationId string `gorm:"type:varchar(1024)"`
}

ServiceInstanceDetailsV2 holds information about provisioned services.

func (ServiceInstanceDetailsV2) TableName

func (ServiceInstanceDetailsV2) TableName() string

TableName returns a consistent table name (`service_instance_details`) for gorm so multiple structs from different versions of the database all operate on the same table.

type TerraformDeployment

type TerraformDeployment TerraformDeploymentV1

TerraformDeployment holds Terraform state and plan information for resources that use that execution system.

type TerraformDeploymentV1

type TerraformDeploymentV1 struct {
	ID        string `gorm:"primary_key",sql:"type:varchar(1024)"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	// Workspace contains a JSON serialized version of the Terraform workspace.
	Workspace string `sql:"type:text"`

	// LastOperationType describes the last operation being performed on the resource.
	LastOperationType string

	// LastOperationState holds one of the following strings "in progress", "succeeded", "failed".
	// These mirror the OSB API.
	LastOperationState string

	// LastOperationMessage is a description that can be passed back to the user.
	LastOperationMessage string
}

TerraformDeploymentV1 describes the state of a Terraform resource deployment.

func (TerraformDeploymentV1) TableName

func (TerraformDeploymentV1) TableName() string

TableName returns a consistent table name (`tf_deployment`) for gorm so multiple structs from different versions of the database all operate on the same table.

Jump to

Keyboard shortcuts

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