db_service

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DbTypeMysql   = "mysql"
	DbTypeSqlite3 = "sqlite3"
)

Variables

View Source
var DbConnection *gorm.DB

Functions

func CheckDeletedCloudOperationById

func CheckDeletedCloudOperationById(id uint) (bool, error)

CheckDeletedCloudOperationById checks to see if an instance of CloudOperation was soft deleted by its key (id).

func CheckDeletedCloudOperationByServiceInstanceId

func CheckDeletedCloudOperationByServiceInstanceId(serviceInstanceId string) (bool, error)

CheckDeletedCloudOperationByServiceInstanceId checks to see if an instance of CloudOperation was soft deleted by its key (serviceInstanceId).

func CheckDeletedPlanDetailsV1ById

func CheckDeletedPlanDetailsV1ById(id string) (bool, error)

CheckDeletedPlanDetailsV1ById checks to see if an instance of PlanDetailsV1 was soft deleted by its key (id).

func CheckDeletedPlanDetailsV1ByServiceIdAndName

func CheckDeletedPlanDetailsV1ByServiceIdAndName(serviceId string, name string) (bool, error)

CheckDeletedPlanDetailsV1ByServiceIdAndName checks to see if an instance of PlanDetailsV1 was soft deleted by its key (serviceId, name).

func CheckDeletedProvisionRequestDetailsById

func CheckDeletedProvisionRequestDetailsById(id uint) (bool, error)

CheckDeletedProvisionRequestDetailsById checks to see if an instance of ProvisionRequestDetails was soft deleted by its key (id).

func CheckDeletedProvisionRequestDetailsByServiceInstanceId

func CheckDeletedProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) (bool, error)

CheckDeletedProvisionRequestDetailsByServiceInstanceId checks to see if an instance of ProvisionRequestDetails was soft deleted by its key (serviceInstanceId).

func CheckDeletedServiceBindingCredentialsByBindingId

func CheckDeletedServiceBindingCredentialsByBindingId(bindingId string) (bool, error)

CheckDeletedServiceBindingCredentialsByBindingId checks to see if an instance of ServiceBindingCredentials was soft deleted by its key (bindingId).

func CheckDeletedServiceBindingCredentialsById

func CheckDeletedServiceBindingCredentialsById(id uint) (bool, error)

CheckDeletedServiceBindingCredentialsById checks to see if an instance of ServiceBindingCredentials was soft deleted by its key (id).

func CheckDeletedServiceBindingCredentialsByServiceInstanceIdAndBindingId

func CheckDeletedServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) (bool, error)

CheckDeletedServiceBindingCredentialsByServiceInstanceIdAndBindingId checks to see if an instance of ServiceBindingCredentials was soft deleted by its key (serviceInstanceId, bindingId).

func CheckDeletedServiceInstanceDetailsById

func CheckDeletedServiceInstanceDetailsById(id string) (bool, error)

CheckDeletedServiceInstanceDetailsById checks to see if an instance of ServiceInstanceDetails was soft deleted by its key (id).

func CountCloudOperationById

func CountCloudOperationById(id uint) (int, error)

CountCloudOperationById gets the count of CloudOperation by its key (id) in the datastore (0 or 1)

func CountCloudOperationByServiceInstanceId

func CountCloudOperationByServiceInstanceId(serviceInstanceId string) (int, error)

CountCloudOperationByServiceInstanceId gets the count of CloudOperation by its key (serviceInstanceId) in the datastore (0 or 1)

func CountPlanDetailsV1ById

func CountPlanDetailsV1ById(id string) (int, error)

CountPlanDetailsV1ById gets the count of PlanDetailsV1 by its key (id) in the datastore (0 or 1)

func CountPlanDetailsV1ByServiceIdAndName

func CountPlanDetailsV1ByServiceIdAndName(serviceId string, name string) (int, error)

CountPlanDetailsV1ByServiceIdAndName gets the count of PlanDetailsV1 by its key (serviceId, name) in the datastore (0 or 1)

func CountProvisionRequestDetailsById

func CountProvisionRequestDetailsById(id uint) (int, error)

CountProvisionRequestDetailsById gets the count of ProvisionRequestDetails by its key (id) in the datastore (0 or 1)

func CountProvisionRequestDetailsByServiceInstanceId

func CountProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) (int, error)

CountProvisionRequestDetailsByServiceInstanceId gets the count of ProvisionRequestDetails by its key (serviceInstanceId) in the datastore (0 or 1)

func CountServiceBindingCredentialsByBindingId

func CountServiceBindingCredentialsByBindingId(bindingId string) (int, error)

CountServiceBindingCredentialsByBindingId gets the count of ServiceBindingCredentials by its key (bindingId) in the datastore (0 or 1)

func CountServiceBindingCredentialsById

func CountServiceBindingCredentialsById(id uint) (int, error)

CountServiceBindingCredentialsById gets the count of ServiceBindingCredentials by its key (id) in the datastore (0 or 1)

func CountServiceBindingCredentialsByServiceInstanceIdAndBindingId

func CountServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) (int, error)

CountServiceBindingCredentialsByServiceInstanceIdAndBindingId gets the count of ServiceBindingCredentials by its key (serviceInstanceId, bindingId) in the datastore (0 or 1)

func CountServiceInstanceDetailsById

func CountServiceInstanceDetailsById(id string) (int, error)

CountServiceInstanceDetailsById gets the count of ServiceInstanceDetails by its key (id) in the datastore (0 or 1)

func CreateCloudOperation

func CreateCloudOperation(object *models.CloudOperation) error

CreateCloudOperation creates a new record in the database and assigns it a primary key.

func CreatePlanDetailsV1

func CreatePlanDetailsV1(object *models.PlanDetailsV1) error

CreatePlanDetailsV1 creates a new record in the database and assigns it a primary key.

func CreateProvisionRequestDetails

func CreateProvisionRequestDetails(object *models.ProvisionRequestDetails) error

CreateProvisionRequestDetails creates a new record in the database and assigns it a primary key.

func CreateServiceBindingCredentials

func CreateServiceBindingCredentials(object *models.ServiceBindingCredentials) error

CreateServiceBindingCredentials creates a new record in the database and assigns it a primary key.

func CreateServiceInstanceDetails

func CreateServiceInstanceDetails(object *models.ServiceInstanceDetails) error

CreateServiceInstanceDetails creates a new record in the database and assigns it a primary key.

func DeleteCloudOperation

func DeleteCloudOperation(record *models.CloudOperation) error

DeleteCloudOperation soft-deletes the record.

func DeleteCloudOperationById

func DeleteCloudOperationById(id uint) error

DeleteCloudOperationById soft-deletes the record by its key (id).

func DeleteCloudOperationByServiceInstanceId

func DeleteCloudOperationByServiceInstanceId(serviceInstanceId string) error

DeleteCloudOperationByServiceInstanceId soft-deletes the record by its key (serviceInstanceId).

func DeletePlanDetailsV1

func DeletePlanDetailsV1(record *models.PlanDetailsV1) error

DeletePlanDetailsV1 soft-deletes the record.

func DeletePlanDetailsV1ById

func DeletePlanDetailsV1ById(id string) error

DeletePlanDetailsV1ById soft-deletes the record by its key (id).

func DeletePlanDetailsV1ByServiceIdAndName

func DeletePlanDetailsV1ByServiceIdAndName(serviceId string, name string) error

DeletePlanDetailsV1ByServiceIdAndName soft-deletes the record by its key (serviceId, name).

func DeleteProvisionRequestDetails

func DeleteProvisionRequestDetails(record *models.ProvisionRequestDetails) error

DeleteProvisionRequestDetails soft-deletes the record.

func DeleteProvisionRequestDetailsById

func DeleteProvisionRequestDetailsById(id uint) error

DeleteProvisionRequestDetailsById soft-deletes the record by its key (id).

func DeleteProvisionRequestDetailsByServiceInstanceId

func DeleteProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) error

DeleteProvisionRequestDetailsByServiceInstanceId soft-deletes the record by its key (serviceInstanceId).

func DeleteServiceBindingCredentials

func DeleteServiceBindingCredentials(record *models.ServiceBindingCredentials) error

DeleteServiceBindingCredentials soft-deletes the record.

func DeleteServiceBindingCredentialsByBindingId

func DeleteServiceBindingCredentialsByBindingId(bindingId string) error

DeleteServiceBindingCredentialsByBindingId soft-deletes the record by its key (bindingId).

func DeleteServiceBindingCredentialsById

func DeleteServiceBindingCredentialsById(id uint) error

DeleteServiceBindingCredentialsById soft-deletes the record by its key (id).

func DeleteServiceBindingCredentialsByServiceInstanceIdAndBindingId

func DeleteServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) error

DeleteServiceBindingCredentialsByServiceInstanceIdAndBindingId soft-deletes the record by its key (serviceInstanceId, bindingId).

func DeleteServiceInstanceDetails

func DeleteServiceInstanceDetails(record *models.ServiceInstanceDetails) error

DeleteServiceInstanceDetails soft-deletes the record.

func DeleteServiceInstanceDetailsById

func DeleteServiceInstanceDetailsById(id string) error

DeleteServiceInstanceDetailsById soft-deletes the record by its key (id).

func GetCloudOperationById

func GetCloudOperationById(id uint) (*models.CloudOperation, error)

GetCloudOperationById gets an instance of CloudOperation by its key (id).

func GetCloudOperationByServiceInstanceId

func GetCloudOperationByServiceInstanceId(serviceInstanceId string) (*models.CloudOperation, error)

GetCloudOperationByServiceInstanceId gets an instance of CloudOperation by its key (serviceInstanceId).

func GetLastOperation

func GetLastOperation(instanceId string) (models.CloudOperation, error)

GetLastOperation gets the most recently created cloud operation for a given service instance id.

func GetPlanDetailsV1ById

func GetPlanDetailsV1ById(id string) (*models.PlanDetailsV1, error)

GetPlanDetailsV1ById gets an instance of PlanDetailsV1 by its key (id).

func GetPlanDetailsV1ByServiceIdAndName

func GetPlanDetailsV1ByServiceIdAndName(serviceId string, name string) (*models.PlanDetailsV1, error)

GetPlanDetailsV1ByServiceIdAndName gets an instance of PlanDetailsV1 by its key (serviceId, name).

func GetProvisionRequestDetailsById

func GetProvisionRequestDetailsById(id uint) (*models.ProvisionRequestDetails, error)

GetProvisionRequestDetailsById gets an instance of ProvisionRequestDetails by its key (id).

func GetProvisionRequestDetailsByServiceInstanceId

func GetProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) (*models.ProvisionRequestDetails, error)

GetProvisionRequestDetailsByServiceInstanceId gets an instance of ProvisionRequestDetails by its key (serviceInstanceId).

func GetServiceBindingCredentialsByBindingId

func GetServiceBindingCredentialsByBindingId(bindingId string) (*models.ServiceBindingCredentials, error)

GetServiceBindingCredentialsByBindingId gets an instance of ServiceBindingCredentials by its key (bindingId).

func GetServiceBindingCredentialsById

func GetServiceBindingCredentialsById(id uint) (*models.ServiceBindingCredentials, error)

GetServiceBindingCredentialsById gets an instance of ServiceBindingCredentials by its key (id).

func GetServiceBindingCredentialsByServiceInstanceIdAndBindingId

func GetServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) (*models.ServiceBindingCredentials, error)

GetServiceBindingCredentialsByServiceInstanceIdAndBindingId gets an instance of ServiceBindingCredentials by its key (serviceInstanceId, bindingId).

func GetServiceInstanceDetailsById

func GetServiceInstanceDetailsById(id string) (*models.ServiceInstanceDetails, error)

GetServiceInstanceDetailsById gets an instance of ServiceInstanceDetails by its key (id).

func New

func New(logger lager.Logger) *gorm.DB

Instantiates the db connection and runs migrations

func RunMigrations

func RunMigrations(db *gorm.DB) error

runs schema migrations on the provided service broker database to get it up to date

func SaveCloudOperation

func SaveCloudOperation(object *models.CloudOperation) error

SaveCloudOperation updates an existing record in the database.

func SavePlanDetailsV1

func SavePlanDetailsV1(object *models.PlanDetailsV1) error

SavePlanDetailsV1 updates an existing record in the database.

func SaveProvisionRequestDetails

func SaveProvisionRequestDetails(object *models.ProvisionRequestDetails) error

SaveProvisionRequestDetails updates an existing record in the database.

func SaveServiceBindingCredentials

func SaveServiceBindingCredentials(object *models.ServiceBindingCredentials) error

SaveServiceBindingCredentials updates an existing record in the database.

func SaveServiceInstanceDetails

func SaveServiceInstanceDetails(object *models.ServiceInstanceDetails) error

SaveServiceInstanceDetails updates an existing record in the database.

func SetupDb

func SetupDb(logger lager.Logger) *gorm.DB

pulls db credentials from the environment, connects to the db, and returns the db connection

Types

type SqlDatastore

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

func (*SqlDatastore) CheckDeletedCloudOperationById

func (ds *SqlDatastore) CheckDeletedCloudOperationById(id uint) (bool, error)

func (*SqlDatastore) CheckDeletedCloudOperationByServiceInstanceId

func (ds *SqlDatastore) CheckDeletedCloudOperationByServiceInstanceId(serviceInstanceId string) (bool, error)

func (*SqlDatastore) CheckDeletedPlanDetailsV1ById

func (ds *SqlDatastore) CheckDeletedPlanDetailsV1ById(id string) (bool, error)

func (*SqlDatastore) CheckDeletedPlanDetailsV1ByServiceIdAndName

func (ds *SqlDatastore) CheckDeletedPlanDetailsV1ByServiceIdAndName(serviceId string, name string) (bool, error)

func (*SqlDatastore) CheckDeletedProvisionRequestDetailsById

func (ds *SqlDatastore) CheckDeletedProvisionRequestDetailsById(id uint) (bool, error)

func (*SqlDatastore) CheckDeletedProvisionRequestDetailsByServiceInstanceId

func (ds *SqlDatastore) CheckDeletedProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) (bool, error)

func (*SqlDatastore) CheckDeletedServiceBindingCredentialsByBindingId

func (ds *SqlDatastore) CheckDeletedServiceBindingCredentialsByBindingId(bindingId string) (bool, error)

func (*SqlDatastore) CheckDeletedServiceBindingCredentialsById

func (ds *SqlDatastore) CheckDeletedServiceBindingCredentialsById(id uint) (bool, error)

func (*SqlDatastore) CheckDeletedServiceBindingCredentialsByServiceInstanceIdAndBindingId

func (ds *SqlDatastore) CheckDeletedServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) (bool, error)

func (*SqlDatastore) CheckDeletedServiceInstanceDetailsById

func (ds *SqlDatastore) CheckDeletedServiceInstanceDetailsById(id string) (bool, error)

func (*SqlDatastore) CountCloudOperationById

func (ds *SqlDatastore) CountCloudOperationById(id uint) (int, error)

func (*SqlDatastore) CountCloudOperationByServiceInstanceId

func (ds *SqlDatastore) CountCloudOperationByServiceInstanceId(serviceInstanceId string) (int, error)

func (*SqlDatastore) CountPlanDetailsV1ById

func (ds *SqlDatastore) CountPlanDetailsV1ById(id string) (int, error)

func (*SqlDatastore) CountPlanDetailsV1ByServiceIdAndName

func (ds *SqlDatastore) CountPlanDetailsV1ByServiceIdAndName(serviceId string, name string) (int, error)

func (*SqlDatastore) CountProvisionRequestDetailsById

func (ds *SqlDatastore) CountProvisionRequestDetailsById(id uint) (int, error)

func (*SqlDatastore) CountProvisionRequestDetailsByServiceInstanceId

func (ds *SqlDatastore) CountProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) (int, error)

func (*SqlDatastore) CountServiceBindingCredentialsByBindingId

func (ds *SqlDatastore) CountServiceBindingCredentialsByBindingId(bindingId string) (int, error)

func (*SqlDatastore) CountServiceBindingCredentialsById

func (ds *SqlDatastore) CountServiceBindingCredentialsById(id uint) (int, error)

func (*SqlDatastore) CountServiceBindingCredentialsByServiceInstanceIdAndBindingId

func (ds *SqlDatastore) CountServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) (int, error)

func (*SqlDatastore) CountServiceInstanceDetailsById

func (ds *SqlDatastore) CountServiceInstanceDetailsById(id string) (int, error)

func (*SqlDatastore) CreateCloudOperation

func (ds *SqlDatastore) CreateCloudOperation(object *models.CloudOperation) error

func (*SqlDatastore) CreatePlanDetailsV1

func (ds *SqlDatastore) CreatePlanDetailsV1(object *models.PlanDetailsV1) error

func (*SqlDatastore) CreateProvisionRequestDetails

func (ds *SqlDatastore) CreateProvisionRequestDetails(object *models.ProvisionRequestDetails) error

func (*SqlDatastore) CreateServiceBindingCredentials

func (ds *SqlDatastore) CreateServiceBindingCredentials(object *models.ServiceBindingCredentials) error

func (*SqlDatastore) CreateServiceInstanceDetails

func (ds *SqlDatastore) CreateServiceInstanceDetails(object *models.ServiceInstanceDetails) error

func (*SqlDatastore) DeleteCloudOperation

func (ds *SqlDatastore) DeleteCloudOperation(record *models.CloudOperation) error

func (*SqlDatastore) DeleteCloudOperationById

func (ds *SqlDatastore) DeleteCloudOperationById(id uint) error

func (*SqlDatastore) DeleteCloudOperationByServiceInstanceId

func (ds *SqlDatastore) DeleteCloudOperationByServiceInstanceId(serviceInstanceId string) error

func (*SqlDatastore) DeletePlanDetailsV1

func (ds *SqlDatastore) DeletePlanDetailsV1(record *models.PlanDetailsV1) error

func (*SqlDatastore) DeletePlanDetailsV1ById

func (ds *SqlDatastore) DeletePlanDetailsV1ById(id string) error

func (*SqlDatastore) DeletePlanDetailsV1ByServiceIdAndName

func (ds *SqlDatastore) DeletePlanDetailsV1ByServiceIdAndName(serviceId string, name string) error

func (*SqlDatastore) DeleteProvisionRequestDetails

func (ds *SqlDatastore) DeleteProvisionRequestDetails(record *models.ProvisionRequestDetails) error

func (*SqlDatastore) DeleteProvisionRequestDetailsById

func (ds *SqlDatastore) DeleteProvisionRequestDetailsById(id uint) error

func (*SqlDatastore) DeleteProvisionRequestDetailsByServiceInstanceId

func (ds *SqlDatastore) DeleteProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) error

func (*SqlDatastore) DeleteServiceBindingCredentials

func (ds *SqlDatastore) DeleteServiceBindingCredentials(record *models.ServiceBindingCredentials) error

func (*SqlDatastore) DeleteServiceBindingCredentialsByBindingId

func (ds *SqlDatastore) DeleteServiceBindingCredentialsByBindingId(bindingId string) error

func (*SqlDatastore) DeleteServiceBindingCredentialsById

func (ds *SqlDatastore) DeleteServiceBindingCredentialsById(id uint) error

func (*SqlDatastore) DeleteServiceBindingCredentialsByServiceInstanceIdAndBindingId

func (ds *SqlDatastore) DeleteServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) error

func (*SqlDatastore) DeleteServiceInstanceDetails

func (ds *SqlDatastore) DeleteServiceInstanceDetails(record *models.ServiceInstanceDetails) error

func (*SqlDatastore) DeleteServiceInstanceDetailsById

func (ds *SqlDatastore) DeleteServiceInstanceDetailsById(id string) error

func (*SqlDatastore) GetCloudOperationById

func (ds *SqlDatastore) GetCloudOperationById(id uint) (*models.CloudOperation, error)

func (*SqlDatastore) GetCloudOperationByServiceInstanceId

func (ds *SqlDatastore) GetCloudOperationByServiceInstanceId(serviceInstanceId string) (*models.CloudOperation, error)

func (*SqlDatastore) GetPlanDetailsV1ById

func (ds *SqlDatastore) GetPlanDetailsV1ById(id string) (*models.PlanDetailsV1, error)

func (*SqlDatastore) GetPlanDetailsV1ByServiceIdAndName

func (ds *SqlDatastore) GetPlanDetailsV1ByServiceIdAndName(serviceId string, name string) (*models.PlanDetailsV1, error)

func (*SqlDatastore) GetProvisionRequestDetailsById

func (ds *SqlDatastore) GetProvisionRequestDetailsById(id uint) (*models.ProvisionRequestDetails, error)

func (*SqlDatastore) GetProvisionRequestDetailsByServiceInstanceId

func (ds *SqlDatastore) GetProvisionRequestDetailsByServiceInstanceId(serviceInstanceId string) (*models.ProvisionRequestDetails, error)

func (*SqlDatastore) GetServiceBindingCredentialsByBindingId

func (ds *SqlDatastore) GetServiceBindingCredentialsByBindingId(bindingId string) (*models.ServiceBindingCredentials, error)

func (*SqlDatastore) GetServiceBindingCredentialsById

func (ds *SqlDatastore) GetServiceBindingCredentialsById(id uint) (*models.ServiceBindingCredentials, error)

func (*SqlDatastore) GetServiceBindingCredentialsByServiceInstanceIdAndBindingId

func (ds *SqlDatastore) GetServiceBindingCredentialsByServiceInstanceIdAndBindingId(serviceInstanceId string, bindingId string) (*models.ServiceBindingCredentials, error)

func (*SqlDatastore) GetServiceInstanceDetailsById

func (ds *SqlDatastore) GetServiceInstanceDetailsById(id string) (*models.ServiceInstanceDetails, error)

func (*SqlDatastore) SaveCloudOperation

func (ds *SqlDatastore) SaveCloudOperation(object *models.CloudOperation) error

func (*SqlDatastore) SavePlanDetailsV1

func (ds *SqlDatastore) SavePlanDetailsV1(object *models.PlanDetailsV1) error

func (*SqlDatastore) SaveProvisionRequestDetails

func (ds *SqlDatastore) SaveProvisionRequestDetails(object *models.ProvisionRequestDetails) error

func (*SqlDatastore) SaveServiceBindingCredentials

func (ds *SqlDatastore) SaveServiceBindingCredentials(object *models.ServiceBindingCredentials) error

func (*SqlDatastore) SaveServiceInstanceDetails

func (ds *SqlDatastore) SaveServiceInstanceDetails(object *models.ServiceInstanceDetails) error

Jump to

Keyboard shortcuts

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