Documentation
¶
Overview ¶
Package models implements database object models for use with GORM
Index ¶
- Constants
- type BindRequestDetails
- type BindRequestDetailsV1
- type CloudOperation
- type CloudOperationV1
- type Migration
- type MigrationV1
- type PasswordMetadata
- type PasswordMetadataV1
- type PlanDetailsV1
- type ProvisionRequestDetails
- type ProvisionRequestDetailsV1
- type ProvisionRequestDetailsV2
- type ProvisionRequestDetailsV3
- type ServiceBindingCredentials
- type ServiceBindingCredentialsV1
- type ServiceBindingCredentialsV2
- type ServiceInstanceDetails
- type ServiceInstanceDetailsV1
- type ServiceInstanceDetailsV2
- type ServiceInstanceDetailsV3
- type TerraformDeployment
- type TerraformDeploymentV1
- type TerraformDeploymentV2
- type TerraformDeploymentV3
Constants ¶
const ( ProvisionOperationType = "provision" DeprovisionOperationType = "deprovision" UpdateOperationType = "update" UpgradeOperationType = "upgrade" BindOperationType = "bind" UnbindOperationType = "unbind" ClearOperationType = "" )
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.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindRequestDetails ¶
type BindRequestDetails BindRequestDetailsV1
BindRequestDetails holds user-defined properties passed to a call to provision a service.
type BindRequestDetailsV1 ¶
type BindRequestDetailsV1 struct {
gorm.Model
ServiceBindingID string `gorm:"unique"`
ServiceInstanceID string
// is a json.Marshal of models.BindDetails
RequestDetails []byte `gorm:"type:blob"`
}
BindRequestDetailsV1 holds user-defined properties passed to a call to provision a service.
func (BindRequestDetailsV1) TableName ¶
func (BindRequestDetailsV1) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.
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 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 migrations table. It holds a monotonically increasing number that gets incremented with every database schema revision.
type MigrationV1 ¶
MigrationV1 represents the migrations 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 for gorm so multiple structs from different versions of the database all operate on the same table.
type PasswordMetadata ¶
type PasswordMetadata PasswordMetadataV1
PasswordMetadata contains information about the passwords, but never the passwords themselves
type PasswordMetadataV1 ¶
type PasswordMetadataV1 struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
Label string `gorm:"index;unique;not null"`
Salt []byte `gorm:"type:blob;not null"`
Canary []byte `gorm:"type:blob;not null"`
Primary bool
}
PasswordMetadataV1 contains information about the passwords, but never the passwords themselves
func (PasswordMetadataV1) TableName ¶
func (PasswordMetadataV1) TableName() string
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 `gorm:"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 for gorm so multiple structs from different versions of the database all operate on the same table.
type ProvisionRequestDetails ¶
type ProvisionRequestDetails ProvisionRequestDetailsV3
ProvisionRequestDetails holds user-defined properties passed to a call to provision a service.
type ProvisionRequestDetailsV1 ¶
type ProvisionRequestDetailsV1 struct {
gorm.Model
ServiceInstanceID string `gorm:"uniqueIndex"`
// 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 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 for gorm so multiple structs from different versions of the database all operate on the same table.
type ProvisionRequestDetailsV3 ¶
type ProvisionRequestDetailsV3 struct {
gorm.Model
ServiceInstanceID string
// is a json.Marshal of models.ProvisionDetails
RequestDetails []byte `gorm:"type:blob"`
}
ProvisionRequestDetailsV3 holds user-defined properties passed to a call to provision a service.
func (ProvisionRequestDetailsV3) TableName ¶
func (ProvisionRequestDetailsV3) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.
type ServiceBindingCredentials ¶
type ServiceBindingCredentials ServiceBindingCredentialsV2
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 for gorm so multiple structs from different versions of the database all operate on the same table.
type ServiceBindingCredentialsV2 ¶
type ServiceBindingCredentialsV2 struct {
gorm.Model
OtherDetails []byte `gorm:"type:blob"`
ServiceID string
ServiceInstanceID string
BindingID string
}
ServiceBindingCredentialsV2 holds credentials returned to the users after binding to a service.
func (ServiceBindingCredentialsV2) TableName ¶
func (ServiceBindingCredentialsV2) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.
type ServiceInstanceDetails ¶
type ServiceInstanceDetails ServiceInstanceDetailsV3
ServiceInstanceDetails holds information about provisioned services.
type ServiceInstanceDetailsV1 ¶
type ServiceInstanceDetailsV1 struct {
ID string `gorm:"primary_key;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 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 for gorm so multiple structs from different versions of the database all operate on the same table.
type ServiceInstanceDetailsV3 ¶
type ServiceInstanceDetailsV3 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 []byte `gorm:"type:blob"`
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)"`
}
ServiceInstanceDetailsV3 holds information about provisioned services.
func (ServiceInstanceDetailsV3) TableName ¶
func (ServiceInstanceDetailsV3) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.
type TerraformDeployment ¶
type TerraformDeployment TerraformDeploymentV3
TerraformDeployment holds Terraform state and plan information for resources that use that execution system.
type TerraformDeploymentV1 ¶
type TerraformDeploymentV1 struct {
ID string `gorm:"primary_key;type:varchar(1024)"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
// Workspace contains a JSON serialized version of the Terraform workspace.
Workspace string `gorm:"type:mediumtext"`
// 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 `gorm:"type:text"`
}
TerraformDeploymentV1 describes the state of a Terraform resource deployment.
func (TerraformDeploymentV1) TableName ¶
func (TerraformDeploymentV1) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.
type TerraformDeploymentV2 ¶
type TerraformDeploymentV2 struct {
ID string `gorm:"primary_key;type:varchar(1024)"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
// Workspace contains a JSON serialized version of the Terraform workspace.
Workspace string `gorm:"type:mediumtext"`
// 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 `gorm:"type:text"`
}
TerraformDeploymentV2 expands the size of the Workspace column to handle deployments where the Terraform workspace is greater than 64K. (mediumtext allows for workspaces up to 16384K.)
func (TerraformDeploymentV2) TableName ¶
func (TerraformDeploymentV2) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.
type TerraformDeploymentV3 ¶
type TerraformDeploymentV3 struct {
ID string `gorm:"primary_key;type:varchar(1024)"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
// Workspace contains a JSON serialized version of the Terraform workspace.
Workspace []byte `gorm:"type:mediumblob"`
// 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 `gorm:"type:text"`
}
TerraformDeploymentV3 converts workspace type from mediumtext to mediumblob
func (TerraformDeploymentV3) TableName ¶
func (TerraformDeploymentV3) TableName() string
TableName returns a consistent table name for gorm so multiple structs from different versions of the database all operate on the same table.