db_service

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbConnection *gorm.DB

Functions

func CheckAndGetPlan

func CheckAndGetPlan(planName string, serviceId string) (bool, models.PlanDetails, error)

Searches the db by planName and serviceId (since plan names must be distinct within services) If the plan is found, returns the count (should be 1, always) and the plan object. If not, returns 0 and an empty plan object

func GetLastOperation

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

func GetOrCreatePlanId

func GetOrCreatePlanId(planName string, serviceId string) (string, error)

Searches the db by planName and serviceId (since plan names must be disctinct within services) If an entry exists, returns its id. If not, constructs a new UUID and returns it.

func GetServiceInstanceCount

func GetServiceInstanceCount(instanceID string) (int, error)

gets the count of service instances by instance id (i.e. 0 or 1)

func GetServiceInstanceTotal

func GetServiceInstanceTotal() (int, error)

gets the totaly number of service instances that are currently provisioned

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 SetupDb

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

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

func SoftDeleteInstanceDetails

func SoftDeleteInstanceDetails(instanceID string) error

soft deletes an instance from the database by instance id

Types

This section is empty.

Jump to

Keyboard shortcuts

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