Documentation ¶
Overview ¶
Package broker holds the code that users of the skeleton write for their broker. To make a broker, fill out:
- The Options type, which holds options for the broker
- The AddFlags function, which adds CLI flags for an Options
- The methods of the BusinessLogic type, which implements the broker's business logic
- The NewBusinessLogic function, which creates a BusinessLogic from the Options the program is run with
Index ¶
- func AddFlags(o *Options)
- func ApplyParamsToStatement(statement string, args ...string) string
- func CanBeDeleted(status string) bool
- func CanBeModified(status string) bool
- func CanGetBindings(status string) bool
- func ConflictErrorWithMessage(description string) error
- func CrudeOSBIHacks(router *mux.Router, b *BusinessLogic)
- func DeleteMysqlReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) error
- func DeletePostgresReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) error
- func FinishedTask(storage Storage, taskId string, retries int64, result string, status string)
- func HttpWrite(w http.ResponseWriter, status int, obj interface{})
- func InProgress(status string) bool
- func InternalServerError() error
- func IsAvailable(status string) bool
- func IsReady(status string) bool
- func NotFound() error
- func RandomString(n int) string
- func RestoreBackup(storage Storage, dbInstance *DbInstance, namePrefix string, backup string) error
- func RunBackgroundTasks(ctx context.Context, o Options) error
- func RunPreprovisionTasks(ctx context.Context, o Options, namePrefix string, storage Storage, wait int64)
- func RunWorkerTasks(ctx context.Context, o Options, namePrefix string, storage Storage) error
- func TickTocPreprovisionTasks(ctx context.Context, o Options, namePrefix string, storage Storage)
- func UnprocessableEntity() error
- func UnprocessableEntityWithMessage(err string, description string) error
- func UpdateTaskStatus(storage Storage, taskId string, retries int64, result string, status string)
- func UpgradeAcrossProviders(storage Storage, fromDb *DbInstance, toPlanId string, namePrefix string) (string, error)
- func UpgradeWithinProviders(storage Storage, fromDb *DbInstance, toPlanId string, namePrefix string) (string, error)
- type AWSClusteredProvider
- func (provider AWSClusteredProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
- func (provider AWSClusteredProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
- func (provider AWSClusteredProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider AWSClusteredProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
- func (provider AWSClusteredProvider) DeleteReadReplica(dbInstance *DbInstance) error
- func (provider AWSClusteredProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
- func (provider AWSClusteredProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
- func (provider AWSClusteredProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
- func (provider AWSClusteredProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
- func (provider AWSClusteredProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider AWSClusteredProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
- func (provider AWSClusteredProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
- func (provider AWSClusteredProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
- func (provider AWSClusteredProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
- func (provider AWSClusteredProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
- func (provider AWSClusteredProvider) Restart(dbInstance *DbInstance) error
- func (provider AWSClusteredProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
- func (provider AWSClusteredProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
- func (provider AWSClusteredProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
- func (provider AWSClusteredProvider) Untag(dbInstance *DbInstance, Name string) error
- func (provider AWSClusteredProvider) UpgradeVersion(dbInstance *DbInstance, proposed string) (*DbInstance, error)
- type AWSClusteredProviderPrivatePlanSettings
- type AWSInstanceProvider
- func (provider AWSInstanceProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
- func (provider AWSInstanceProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
- func (provider AWSInstanceProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider AWSInstanceProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
- func (provider AWSInstanceProvider) DeleteReadReplica(dbInstance *DbInstance) error
- func (provider AWSInstanceProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
- func (provider AWSInstanceProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
- func (provider AWSInstanceProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
- func (provider AWSInstanceProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
- func (provider AWSInstanceProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider AWSInstanceProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
- func (provider AWSInstanceProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
- func (provider AWSInstanceProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
- func (provider AWSInstanceProvider) ModifyWithSettings(dbInstance *DbInstance, plan *ProviderPlan, ...) (*DbInstance, error)
- func (provider AWSInstanceProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
- func (provider AWSInstanceProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
- func (provider AWSInstanceProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *rds.CreateDBInstanceInput) (*DbInstance, error)
- func (provider AWSInstanceProvider) Restart(dbInstance *DbInstance) error
- func (provider AWSInstanceProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
- func (provider AWSInstanceProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
- func (provider AWSInstanceProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
- func (provider AWSInstanceProvider) Untag(dbInstance *DbInstance, Name string) error
- func (provider AWSInstanceProvider) UpgradeVersion(dbInstance *DbInstance, proposed string, settings *rds.CreateDBInstanceInput) (*DbInstance, error)
- type Action
- type ActionBase
- func (b *ActionBase) ActionSchemaHandler(w http.ResponseWriter, r *http.Request)
- func (b *ActionBase) AddActions(name string, path string, method string, ...) error
- func (b *ActionBase) ConvertActionsToExtensions(serviceId string) []osb.ExtensionAPI
- func (b *ActionBase) RouteActions(router *mux.Router) error
- type BusinessLogic
- func (b *BusinessLogic) ActionCreateBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionCreateReplica(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionCreateRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionDeleteReplica(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionDeleteRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionGetBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionGetLogs(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionGetReplica(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionGetRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionListBackups(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionListLogs(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionListRoles(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionRestart(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionRestoreBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionRotateRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionViewLogs(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) Bind(request *osb.BindRequest, c *broker.RequestContext) (*broker.BindResponse, error)
- func (b *BusinessLogic) Deprovision(request *osb.DeprovisionRequest, c *broker.RequestContext) (*broker.DeprovisionResponse, error)
- func (b *BusinessLogic) GetBinding(request *osb.GetBindingRequest, context *broker.RequestContext) (*osb.GetBindingResponse, error)
- func (b *BusinessLogic) GetCatalog(c *broker.RequestContext) (*broker.CatalogResponse, error)
- func (b *BusinessLogic) GetInstanceById(Id string) (*DbInstance, error)
- func (b *BusinessLogic) GetUnclaimedInstance(PlanId string, InstanceId string) (*DbInstance, error)
- func (b *BusinessLogic) LastOperation(request *osb.LastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
- func (b *BusinessLogic) Provision(request *osb.ProvisionRequest, c *broker.RequestContext) (*broker.ProvisionResponse, error)
- func (b *BusinessLogic) Unbind(request *osb.UnbindRequest, c *broker.RequestContext) (*broker.UnbindResponse, error)
- func (b *BusinessLogic) Update(request *osb.UpdateInstanceRequest, c *broker.RequestContext) (*broker.UpdateInstanceResponse, error)
- func (b *BusinessLogic) ValidateBrokerAPIVersion(version string) error
- type ChangePlansTaskMetadata
- type ChangeProvidersTaskMetadata
- type DatabaseBackupSpec
- type DatabaseLogs
- type DatabaseSpec
- type DatabaseUrlSpec
- func CreateMysqlReadOnlyRole(dbInstance *DbInstance, databaseUri string) (DatabaseUrlSpec, error)
- func CreatePostgresReadOnlyRole(dbInstance *DbInstance, databaseUri string) (DatabaseUrlSpec, error)
- func RotateMysqlReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) (DatabaseUrlSpec, error)
- func RotatePostgresReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) (DatabaseUrlSpec, error)
- type DbEntry
- type DbInstance
- type GCloudInstanceProvider
- func (provider GCloudInstanceProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
- func (provider GCloudInstanceProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
- func (provider GCloudInstanceProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider GCloudInstanceProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
- func (provider GCloudInstanceProvider) DeleteReadReplica(dbInstance *DbInstance) error
- func (provider GCloudInstanceProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
- func (provider GCloudInstanceProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
- func (provider GCloudInstanceProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
- func (provider GCloudInstanceProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
- func (provider GCloudInstanceProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider GCloudInstanceProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
- func (provider GCloudInstanceProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
- func (provider GCloudInstanceProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
- func (provider GCloudInstanceProvider) ModifyWithSettings(dbInstance *DbInstance, plan *ProviderPlan, settings *sqladmin.Settings) (*DbInstance, error)
- func (provider GCloudInstanceProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
- func (provider GCloudInstanceProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
- func (provider GCloudInstanceProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *sqladmin.DatabaseInstance, ...) (*DbInstance, error)
- func (provider GCloudInstanceProvider) Restart(dbInstance *DbInstance) error
- func (provider GCloudInstanceProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
- func (provider GCloudInstanceProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
- func (provider GCloudInstanceProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
- func (provider GCloudInstanceProvider) Untag(dbInstance *DbInstance, Name string) error
- type MysqlSharedProvider
- func (provider MysqlSharedProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
- func (provider MysqlSharedProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
- func (provider MysqlSharedProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider MysqlSharedProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
- func (provider MysqlSharedProvider) DeleteReadReplica(dbInstance *DbInstance) error
- func (provider MysqlSharedProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
- func (provider MysqlSharedProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
- func (provider MysqlSharedProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
- func (provider MysqlSharedProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
- func (provider MysqlSharedProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider MysqlSharedProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
- func (provider MysqlSharedProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
- func (provider MysqlSharedProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
- func (provider MysqlSharedProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
- func (provider MysqlSharedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
- func (provider MysqlSharedProvider) Restart(dbInstance *DbInstance) error
- func (provider MysqlSharedProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
- func (provider MysqlSharedProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
- func (provider MysqlSharedProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
- func (provider MysqlSharedProvider) Untag(dbInstance *DbInstance, Name string) error
- type MysqlSharedProviderPrivatePlanSettings
- func (psppps MysqlSharedProviderPrivatePlanSettings) GetMasterUriAsDsn() string
- func (psppps MysqlSharedProviderPrivatePlanSettings) GetMasterUriWithDb(dbName string) string
- func (psppps MysqlSharedProviderPrivatePlanSettings) GetMasterUriWithDbAsDsn(dbName string) string
- func (psppps MysqlSharedProviderPrivatePlanSettings) MasterHost() string
- type Options
- type PostgresSharedProvider
- func (provider PostgresSharedProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
- func (provider PostgresSharedProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
- func (provider PostgresSharedProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider PostgresSharedProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
- func (provider PostgresSharedProvider) DeleteReadReplica(dbInstance *DbInstance) error
- func (provider PostgresSharedProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
- func (provider PostgresSharedProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
- func (provider PostgresSharedProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
- func (provider PostgresSharedProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
- func (provider PostgresSharedProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
- func (provider PostgresSharedProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
- func (provider PostgresSharedProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
- func (provider PostgresSharedProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
- func (provider PostgresSharedProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
- func (provider PostgresSharedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
- func (provider PostgresSharedProvider) Restart(dbInstance *DbInstance) error
- func (provider PostgresSharedProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
- func (provider PostgresSharedProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
- func (provider PostgresSharedProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
- func (provider PostgresSharedProvider) Untag(dbInstance *DbInstance, Name string) error
- type PostgresSharedProviderPrivatePlanSettings
- type PostgresStorage
- func (b *PostgresStorage) AddInstance(dbInstance *DbInstance) error
- func (b *PostgresStorage) AddReplica(dbInstance *DbInstance) error
- func (b *PostgresStorage) AddRole(dbInstance *DbInstance, username string, password string) (DatabaseUrlSpec, error)
- func (b *PostgresStorage) AddTask(Id string, action TaskAction, metadata string) (string, error)
- func (b *PostgresStorage) DeleteInstance(dbInstance *DbInstance) error
- func (b *PostgresStorage) DeleteReplica(dbInstance *DbInstance) error
- func (b *PostgresStorage) DeleteRole(dbInstance *DbInstance, username string) error
- func (b *PostgresStorage) GetInstance(Id string) (*DbEntry, error)
- func (b *PostgresStorage) GetPlanByID(planId string) (*ProviderPlan, error)
- func (b *PostgresStorage) GetPlans(serviceId string) ([]ProviderPlan, error)
- func (b *PostgresStorage) GetReplicas(dbInstance *DbInstance) (DatabaseUrlSpec, error)
- func (b *PostgresStorage) GetRole(dbInstance *DbInstance, r string) (DatabaseUrlSpec, error)
- func (b *PostgresStorage) GetServices() ([]osb.Service, error)
- func (b *PostgresStorage) GetUnclaimedInstance(PlanId string, InstanceId string) (*DbEntry, error)
- func (b *PostgresStorage) HasReplicas(dbInstance *DbInstance) (int64, error)
- func (b *PostgresStorage) HasRole(dbInstance *DbInstance, username string) (int64, error)
- func (b *PostgresStorage) IsRestoring(dbId string) (bool, error)
- func (b *PostgresStorage) IsUpgrading(dbId string) (bool, error)
- func (b *PostgresStorage) ListRoles(dbInstance *DbInstance) ([]DatabaseUrlSpec, error)
- func (b *PostgresStorage) NukeInstance(Id string) error
- func (b *PostgresStorage) PopPendingTask() (*Task, error)
- func (b *PostgresStorage) ReturnClaimedInstance(Id string) error
- func (b *PostgresStorage) StartProvisioningTasks() ([]DbEntry, error)
- func (b *PostgresStorage) UpdateInstance(dbInstance *DbInstance, PlanId string) error
- func (b *PostgresStorage) UpdateReplica(dbInstance *DbInstance) error
- func (b *PostgresStorage) UpdateRole(dbInstance *DbInstance, username string, password string) (DatabaseUrlSpec, error)
- func (b *PostgresStorage) UpdateTask(Id string, status *string, retries *int64, metadata *string, result *string, ...) error
- func (b *PostgresStorage) ValidateInstanceID(id string) error
- func (b *PostgresStorage) WarnOnUnfinishedTasks()
- type Provider
- type ProviderPlan
- type Providers
- type RestoreDbTaskMetadata
- type Storage
- type Task
- type TaskAction
- type WebhookTaskMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyParamsToStatement ¶
func CanBeDeleted ¶
func CanBeModified ¶
func CanGetBindings ¶
func CrudeOSBIHacks ¶
func CrudeOSBIHacks(router *mux.Router, b *BusinessLogic)
These are hacks to support more of V2.14 such as get service instance and get service bindings.
func DeleteMysqlReadOnlyRole ¶
func DeleteMysqlReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) error
func DeletePostgresReadOnlyRole ¶
func DeletePostgresReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) error
func FinishedTask ¶
func HttpWrite ¶
func HttpWrite(w http.ResponseWriter, status int, obj interface{})
func InProgress ¶
func InternalServerError ¶
func InternalServerError() error
func IsAvailable ¶
func RandomString ¶
func RestoreBackup ¶
func RestoreBackup(storage Storage, dbInstance *DbInstance, namePrefix string, backup string) error
func RunPreprovisionTasks ¶
func RunWorkerTasks ¶
func UnprocessableEntity ¶
func UnprocessableEntity() error
func UpdateTaskStatus ¶
func UpgradeAcrossProviders ¶
func UpgradeWithinProviders ¶
Types ¶
type AWSClusteredProvider ¶
type AWSClusteredProvider struct { Provider // contains filtered or unexported fields }
func NewAWSClusteredProvider ¶
func NewAWSClusteredProvider(namePrefix string) (*AWSClusteredProvider, error)
func (AWSClusteredProvider) CreateBackup ¶
func (provider AWSClusteredProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
func (AWSClusteredProvider) CreateReadOnlyUser ¶
func (provider AWSClusteredProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
func (AWSClusteredProvider) CreateReadReplica ¶
func (provider AWSClusteredProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (AWSClusteredProvider) DeleteReadOnlyUser ¶
func (provider AWSClusteredProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
func (AWSClusteredProvider) DeleteReadReplica ¶
func (provider AWSClusteredProvider) DeleteReadReplica(dbInstance *DbInstance) error
func (AWSClusteredProvider) Deprovision ¶
func (provider AWSClusteredProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
func (AWSClusteredProvider) GetBackup ¶
func (provider AWSClusteredProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
func (AWSClusteredProvider) GetInstance ¶
func (provider AWSClusteredProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
func (AWSClusteredProvider) GetLogs ¶
func (provider AWSClusteredProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
func (AWSClusteredProvider) GetReadReplica ¶
func (provider AWSClusteredProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (AWSClusteredProvider) ListBackups ¶
func (provider AWSClusteredProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
func (AWSClusteredProvider) ListLogs ¶
func (provider AWSClusteredProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
func (AWSClusteredProvider) Modify ¶
func (provider AWSClusteredProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
func (AWSClusteredProvider) PerformPostProvision ¶
func (provider AWSClusteredProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
func (AWSClusteredProvider) Provision ¶
func (provider AWSClusteredProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
func (AWSClusteredProvider) Restart ¶
func (provider AWSClusteredProvider) Restart(dbInstance *DbInstance) error
func (AWSClusteredProvider) RestoreBackup ¶
func (provider AWSClusteredProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
func (AWSClusteredProvider) RotatePasswordReadOnlyUser ¶
func (provider AWSClusteredProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
func (AWSClusteredProvider) Tag ¶
func (provider AWSClusteredProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
func (AWSClusteredProvider) Untag ¶
func (provider AWSClusteredProvider) Untag(dbInstance *DbInstance, Name string) error
func (AWSClusteredProvider) UpgradeVersion ¶
func (provider AWSClusteredProvider) UpgradeVersion(dbInstance *DbInstance, proposed string) (*DbInstance, error)
type AWSClusteredProviderPrivatePlanSettings ¶
type AWSClusteredProviderPrivatePlanSettings struct { Instance rds.CreateDBInstanceInput `json:"Instance"` Cluster rds.CreateDBClusterInput `json:"Cluster"` }
type AWSInstanceProvider ¶
type AWSInstanceProvider struct { Provider // contains filtered or unexported fields }
func NewAWSInstanceProvider ¶
func NewAWSInstanceProvider(namePrefix string) (*AWSInstanceProvider, error)
func (AWSInstanceProvider) CreateBackup ¶
func (provider AWSInstanceProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
func (AWSInstanceProvider) CreateReadOnlyUser ¶
func (provider AWSInstanceProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
func (AWSInstanceProvider) CreateReadReplica ¶
func (provider AWSInstanceProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (AWSInstanceProvider) DeleteReadOnlyUser ¶
func (provider AWSInstanceProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
func (AWSInstanceProvider) DeleteReadReplica ¶
func (provider AWSInstanceProvider) DeleteReadReplica(dbInstance *DbInstance) error
func (AWSInstanceProvider) Deprovision ¶
func (provider AWSInstanceProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
func (AWSInstanceProvider) GetBackup ¶
func (provider AWSInstanceProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
func (AWSInstanceProvider) GetInstance ¶
func (provider AWSInstanceProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
func (AWSInstanceProvider) GetLogs ¶
func (provider AWSInstanceProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
func (AWSInstanceProvider) GetReadReplica ¶
func (provider AWSInstanceProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (AWSInstanceProvider) ListBackups ¶
func (provider AWSInstanceProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
func (AWSInstanceProvider) ListLogs ¶
func (provider AWSInstanceProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
func (AWSInstanceProvider) Modify ¶
func (provider AWSInstanceProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
func (AWSInstanceProvider) ModifyWithSettings ¶
func (provider AWSInstanceProvider) ModifyWithSettings(dbInstance *DbInstance, plan *ProviderPlan, settings *rds.CreateDBInstanceInput) (*DbInstance, error)
func (AWSInstanceProvider) PerformPostProvision ¶
func (provider AWSInstanceProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
func (AWSInstanceProvider) Provision ¶
func (provider AWSInstanceProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
func (AWSInstanceProvider) ProvisionWithSettings ¶
func (provider AWSInstanceProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *rds.CreateDBInstanceInput) (*DbInstance, error)
func (AWSInstanceProvider) Restart ¶
func (provider AWSInstanceProvider) Restart(dbInstance *DbInstance) error
func (AWSInstanceProvider) RestoreBackup ¶
func (provider AWSInstanceProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
func (AWSInstanceProvider) RotatePasswordReadOnlyUser ¶
func (provider AWSInstanceProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
func (AWSInstanceProvider) Tag ¶
func (provider AWSInstanceProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
func (AWSInstanceProvider) Untag ¶
func (provider AWSInstanceProvider) Untag(dbInstance *DbInstance, Name string) error
func (AWSInstanceProvider) UpgradeVersion ¶
func (provider AWSInstanceProvider) UpgradeVersion(dbInstance *DbInstance, proposed string, settings *rds.CreateDBInstanceInput) (*DbInstance, error)
type ActionBase ¶
func (*ActionBase) ActionSchemaHandler ¶
func (b *ActionBase) ActionSchemaHandler(w http.ResponseWriter, r *http.Request)
func (*ActionBase) AddActions ¶
func (*ActionBase) ConvertActionsToExtensions ¶
func (b *ActionBase) ConvertActionsToExtensions(serviceId string) []osb.ExtensionAPI
func (*ActionBase) RouteActions ¶
func (b *ActionBase) RouteActions(router *mux.Router) error
type BusinessLogic ¶
type BusinessLogic struct { ActionBase // contains filtered or unexported fields }
func NewBusinessLogic ¶
func NewBusinessLogic(ctx context.Context, o Options) (*BusinessLogic, error)
func (*BusinessLogic) ActionCreateBackup ¶
func (b *BusinessLogic) ActionCreateBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionCreateReplica ¶
func (b *BusinessLogic) ActionCreateReplica(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionCreateRole ¶
func (b *BusinessLogic) ActionCreateRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionDeleteReplica ¶
func (b *BusinessLogic) ActionDeleteReplica(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionDeleteRole ¶
func (b *BusinessLogic) ActionDeleteRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionGetBackup ¶
func (b *BusinessLogic) ActionGetBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionGetLogs ¶
func (b *BusinessLogic) ActionGetLogs(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionGetReplica ¶
func (b *BusinessLogic) ActionGetReplica(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionGetRole ¶
func (b *BusinessLogic) ActionGetRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionListBackups ¶
func (b *BusinessLogic) ActionListBackups(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionListLogs ¶
func (b *BusinessLogic) ActionListLogs(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionListRoles ¶
func (b *BusinessLogic) ActionListRoles(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionRestart ¶
func (b *BusinessLogic) ActionRestart(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionRestoreBackup ¶
func (b *BusinessLogic) ActionRestoreBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionRotateRole ¶
func (b *BusinessLogic) ActionRotateRole(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionViewLogs ¶
func (b *BusinessLogic) ActionViewLogs(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) Bind ¶
func (b *BusinessLogic) Bind(request *osb.BindRequest, c *broker.RequestContext) (*broker.BindResponse, error)
func (*BusinessLogic) Deprovision ¶
func (b *BusinessLogic) Deprovision(request *osb.DeprovisionRequest, c *broker.RequestContext) (*broker.DeprovisionResponse, error)
func (*BusinessLogic) GetBinding ¶
func (b *BusinessLogic) GetBinding(request *osb.GetBindingRequest, context *broker.RequestContext) (*osb.GetBindingResponse, error)
func (*BusinessLogic) GetCatalog ¶
func (b *BusinessLogic) GetCatalog(c *broker.RequestContext) (*broker.CatalogResponse, error)
func (*BusinessLogic) GetInstanceById ¶
func (b *BusinessLogic) GetInstanceById(Id string) (*DbInstance, error)
func (*BusinessLogic) GetUnclaimedInstance ¶
func (b *BusinessLogic) GetUnclaimedInstance(PlanId string, InstanceId string) (*DbInstance, error)
func (*BusinessLogic) LastOperation ¶
func (b *BusinessLogic) LastOperation(request *osb.LastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
func (*BusinessLogic) Provision ¶
func (b *BusinessLogic) Provision(request *osb.ProvisionRequest, c *broker.RequestContext) (*broker.ProvisionResponse, error)
A peice of advice, never try to make this syncronous by waiting for a to return a response. The problem is that can take up to 10 minutes in my experience (depending on the provider), and aside from the API call timing out the other issue is it can cause the mutex lock to make the entire API unresponsive.
func (*BusinessLogic) Unbind ¶
func (b *BusinessLogic) Unbind(request *osb.UnbindRequest, c *broker.RequestContext) (*broker.UnbindResponse, error)
func (*BusinessLogic) Update ¶
func (b *BusinessLogic) Update(request *osb.UpdateInstanceRequest, c *broker.RequestContext) (*broker.UpdateInstanceResponse, error)
func (*BusinessLogic) ValidateBrokerAPIVersion ¶
func (b *BusinessLogic) ValidateBrokerAPIVersion(version string) error
type ChangePlansTaskMetadata ¶
type ChangePlansTaskMetadata struct {
Plan string `json:"plan"`
}
type ChangeProvidersTaskMetadata ¶
type ChangeProvidersTaskMetadata struct {
Plan string `json:"plan"`
}
type DatabaseBackupSpec ¶
type DatabaseBackupSpec struct { Database DatabaseSpec `json:"database"` Id *string `json:"id"` Progress *int64 `json:"progress"` Status *string `json:"status"` Created string `json:"created_at"` }
type DatabaseLogs ¶
type DatabaseSpec ¶
type DatabaseSpec struct {
Name string `json:"name"`
}
type DatabaseUrlSpec ¶
func CreateMysqlReadOnlyRole ¶
func CreateMysqlReadOnlyRole(dbInstance *DbInstance, databaseUri string) (DatabaseUrlSpec, error)
Technically the create role functions are used by any provider that implements mysql but we'll place them here, but be aware they're not specific to this provider.
func CreatePostgresReadOnlyRole ¶
func CreatePostgresReadOnlyRole(dbInstance *DbInstance, databaseUri string) (DatabaseUrlSpec, error)
Technically the create role functions are used by any provider that implements postgres but we'll place them here, but be aware they're not specific to this provider.
func RotateMysqlReadOnlyRole ¶
func RotateMysqlReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) (DatabaseUrlSpec, error)
func RotatePostgresReadOnlyRole ¶
func RotatePostgresReadOnlyRole(dbInstance *DbInstance, databaseUri string, role string) (DatabaseUrlSpec, error)
type DbInstance ¶
type DbInstance struct { Id string `json:"id"` Name string `json:"name"` ProviderId string `json:"provider_id"` Plan *ProviderPlan `json:"plan,omitempty"` Username string `json:"username"` Password string `json:"password"` Endpoint string `json:"endpoint"` Status string `json:"status"` Ready bool `json:"ready"` Engine string `json:"engine"` EngineVersion string `json:"engine_version"` Scheme string `json:"scheme"` }
func GetInstanceById ¶
func GetInstanceById(namePrefix string, storage Storage, Id string) (*DbInstance, error)
func GetReplicaById ¶
func GetReplicaById(namePrefix string, storage Storage, Id string) (*DbInstance, error)
func (*DbInstance) Match ¶
func (i *DbInstance) Match(other *DbInstance) bool
type GCloudInstanceProvider ¶
type GCloudInstanceProvider struct { Provider // contains filtered or unexported fields }
func NewGCloudInstanceProvider ¶
func NewGCloudInstanceProvider(namePrefix string) (*GCloudInstanceProvider, error)
func (GCloudInstanceProvider) CreateBackup ¶
func (provider GCloudInstanceProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
func (GCloudInstanceProvider) CreateReadOnlyUser ¶
func (provider GCloudInstanceProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
func (GCloudInstanceProvider) CreateReadReplica ¶
func (provider GCloudInstanceProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (GCloudInstanceProvider) DeleteReadOnlyUser ¶
func (provider GCloudInstanceProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
func (GCloudInstanceProvider) DeleteReadReplica ¶
func (provider GCloudInstanceProvider) DeleteReadReplica(dbInstance *DbInstance) error
func (GCloudInstanceProvider) Deprovision ¶
func (provider GCloudInstanceProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
func (GCloudInstanceProvider) GetBackup ¶
func (provider GCloudInstanceProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
func (GCloudInstanceProvider) GetInstance ¶
func (provider GCloudInstanceProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
func (GCloudInstanceProvider) GetLogs ¶
func (provider GCloudInstanceProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
func (GCloudInstanceProvider) GetReadReplica ¶
func (provider GCloudInstanceProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (GCloudInstanceProvider) ListBackups ¶
func (provider GCloudInstanceProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
func (GCloudInstanceProvider) ListLogs ¶
func (provider GCloudInstanceProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
func (GCloudInstanceProvider) Modify ¶
func (provider GCloudInstanceProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
func (GCloudInstanceProvider) ModifyWithSettings ¶
func (provider GCloudInstanceProvider) ModifyWithSettings(dbInstance *DbInstance, plan *ProviderPlan, settings *sqladmin.Settings) (*DbInstance, error)
func (GCloudInstanceProvider) PerformPostProvision ¶
func (provider GCloudInstanceProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
func (GCloudInstanceProvider) Provision ¶
func (provider GCloudInstanceProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
func (GCloudInstanceProvider) ProvisionWithSettings ¶
func (provider GCloudInstanceProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *sqladmin.DatabaseInstance, user *sqladmin.User) (*DbInstance, error)
func (GCloudInstanceProvider) Restart ¶
func (provider GCloudInstanceProvider) Restart(dbInstance *DbInstance) error
func (GCloudInstanceProvider) RestoreBackup ¶
func (provider GCloudInstanceProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
func (GCloudInstanceProvider) RotatePasswordReadOnlyUser ¶
func (provider GCloudInstanceProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
func (GCloudInstanceProvider) Tag ¶
func (provider GCloudInstanceProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
func (GCloudInstanceProvider) Untag ¶
func (provider GCloudInstanceProvider) Untag(dbInstance *DbInstance, Name string) error
type MysqlSharedProvider ¶
type MysqlSharedProvider struct { // contains filtered or unexported fields }
func NewMysqlSharedProvider ¶
func NewMysqlSharedProvider(namePrefix string) (MysqlSharedProvider, error)
func (MysqlSharedProvider) CreateBackup ¶
func (provider MysqlSharedProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
func (MysqlSharedProvider) CreateReadOnlyUser ¶
func (provider MysqlSharedProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
func (MysqlSharedProvider) CreateReadReplica ¶
func (provider MysqlSharedProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (MysqlSharedProvider) DeleteReadOnlyUser ¶
func (provider MysqlSharedProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
func (MysqlSharedProvider) DeleteReadReplica ¶
func (provider MysqlSharedProvider) DeleteReadReplica(dbInstance *DbInstance) error
func (MysqlSharedProvider) Deprovision ¶
func (provider MysqlSharedProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
TODO: take snapshot somehow.
func (MysqlSharedProvider) GetBackup ¶
func (provider MysqlSharedProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
func (MysqlSharedProvider) GetInstance ¶
func (provider MysqlSharedProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
func (MysqlSharedProvider) GetLogs ¶
func (provider MysqlSharedProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
func (MysqlSharedProvider) GetReadReplica ¶
func (provider MysqlSharedProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (MysqlSharedProvider) ListBackups ¶
func (provider MysqlSharedProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
func (MysqlSharedProvider) ListLogs ¶
func (provider MysqlSharedProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
func (MysqlSharedProvider) Modify ¶
func (provider MysqlSharedProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
func (MysqlSharedProvider) PerformPostProvision ¶
func (provider MysqlSharedProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
func (MysqlSharedProvider) Provision ¶
func (provider MysqlSharedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
func (MysqlSharedProvider) Restart ¶
func (provider MysqlSharedProvider) Restart(dbInstance *DbInstance) error
func (MysqlSharedProvider) RestoreBackup ¶
func (provider MysqlSharedProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
func (MysqlSharedProvider) RotatePasswordReadOnlyUser ¶
func (provider MysqlSharedProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
func (MysqlSharedProvider) Tag ¶
func (provider MysqlSharedProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
func (MysqlSharedProvider) Untag ¶
func (provider MysqlSharedProvider) Untag(dbInstance *DbInstance, Name string) error
type MysqlSharedProviderPrivatePlanSettings ¶
type MysqlSharedProviderPrivatePlanSettings struct {}
provider=shared-mysql in database These values come out of the plans table provider_private_details column.
func (MysqlSharedProviderPrivatePlanSettings) GetMasterUriAsDsn ¶
func (psppps MysqlSharedProviderPrivatePlanSettings) GetMasterUriAsDsn() string
func (MysqlSharedProviderPrivatePlanSettings) GetMasterUriWithDb ¶
func (psppps MysqlSharedProviderPrivatePlanSettings) GetMasterUriWithDb(dbName string) string
func (MysqlSharedProviderPrivatePlanSettings) GetMasterUriWithDbAsDsn ¶
func (psppps MysqlSharedProviderPrivatePlanSettings) GetMasterUriWithDbAsDsn(dbName string) string
func (MysqlSharedProviderPrivatePlanSettings) MasterHost ¶
func (psppps MysqlSharedProviderPrivatePlanSettings) MasterHost() string
type PostgresSharedProvider ¶
type PostgresSharedProvider struct { // contains filtered or unexported fields }
func NewPostgresSharedProvider ¶
func NewPostgresSharedProvider(namePrefix string) (PostgresSharedProvider, error)
func (PostgresSharedProvider) CreateBackup ¶
func (provider PostgresSharedProvider) CreateBackup(dbInstance *DbInstance) (DatabaseBackupSpec, error)
func (PostgresSharedProvider) CreateReadOnlyUser ¶
func (provider PostgresSharedProvider) CreateReadOnlyUser(dbInstance *DbInstance) (DatabaseUrlSpec, error)
func (PostgresSharedProvider) CreateReadReplica ¶
func (provider PostgresSharedProvider) CreateReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (PostgresSharedProvider) DeleteReadOnlyUser ¶
func (provider PostgresSharedProvider) DeleteReadOnlyUser(dbInstance *DbInstance, role string) error
func (PostgresSharedProvider) DeleteReadReplica ¶
func (provider PostgresSharedProvider) DeleteReadReplica(dbInstance *DbInstance) error
func (PostgresSharedProvider) Deprovision ¶
func (provider PostgresSharedProvider) Deprovision(dbInstance *DbInstance, takeSnapshot bool) error
TODO: take snapshot somehow.
func (PostgresSharedProvider) GetBackup ¶
func (provider PostgresSharedProvider) GetBackup(dbInstance *DbInstance, Id string) (DatabaseBackupSpec, error)
func (PostgresSharedProvider) GetInstance ¶
func (provider PostgresSharedProvider) GetInstance(name string, plan *ProviderPlan) (*DbInstance, error)
func (PostgresSharedProvider) GetLogs ¶
func (provider PostgresSharedProvider) GetLogs(dbInstance *DbInstance, path string) (string, error)
func (PostgresSharedProvider) GetReadReplica ¶
func (provider PostgresSharedProvider) GetReadReplica(dbInstance *DbInstance) (*DbInstance, error)
func (PostgresSharedProvider) ListBackups ¶
func (provider PostgresSharedProvider) ListBackups(dbInstance *DbInstance) ([]DatabaseBackupSpec, error)
func (PostgresSharedProvider) ListLogs ¶
func (provider PostgresSharedProvider) ListLogs(dbInstance *DbInstance) ([]DatabaseLogs, error)
func (PostgresSharedProvider) Modify ¶
func (provider PostgresSharedProvider) Modify(dbInstance *DbInstance, plan *ProviderPlan) (*DbInstance, error)
func (PostgresSharedProvider) PerformPostProvision ¶
func (provider PostgresSharedProvider) PerformPostProvision(db *DbInstance) (*DbInstance, error)
func (PostgresSharedProvider) Provision ¶
func (provider PostgresSharedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*DbInstance, error)
func (PostgresSharedProvider) Restart ¶
func (provider PostgresSharedProvider) Restart(dbInstance *DbInstance) error
func (PostgresSharedProvider) RestoreBackup ¶
func (provider PostgresSharedProvider) RestoreBackup(dbInstance *DbInstance, Id string) error
func (PostgresSharedProvider) RotatePasswordReadOnlyUser ¶
func (provider PostgresSharedProvider) RotatePasswordReadOnlyUser(dbInstance *DbInstance, role string) (DatabaseUrlSpec, error)
func (PostgresSharedProvider) Tag ¶
func (provider PostgresSharedProvider) Tag(dbInstance *DbInstance, Name string, Value string) error
func (PostgresSharedProvider) Untag ¶
func (provider PostgresSharedProvider) Untag(dbInstance *DbInstance, Name string) error
type PostgresSharedProviderPrivatePlanSettings ¶
type PostgresSharedProviderPrivatePlanSettings struct {}
provider=shared-postgres in database These values come out of the plans table provider_private_details column.
func (PostgresSharedProviderPrivatePlanSettings) GetMasterUriWithDb ¶
func (psppps PostgresSharedProviderPrivatePlanSettings) GetMasterUriWithDb(dbName string) string
func (PostgresSharedProviderPrivatePlanSettings) MasterHost ¶
func (psppps PostgresSharedProviderPrivatePlanSettings) MasterHost() string
type PostgresStorage ¶
type PostgresStorage struct { Storage // contains filtered or unexported fields }
func InitStorage ¶
func InitStorage(ctx context.Context, o Options) (*PostgresStorage, error)
func (*PostgresStorage) AddInstance ¶
func (b *PostgresStorage) AddInstance(dbInstance *DbInstance) error
func (*PostgresStorage) AddReplica ¶
func (b *PostgresStorage) AddReplica(dbInstance *DbInstance) error
func (*PostgresStorage) AddRole ¶
func (b *PostgresStorage) AddRole(dbInstance *DbInstance, username string, password string) (DatabaseUrlSpec, error)
func (*PostgresStorage) AddTask ¶
func (b *PostgresStorage) AddTask(Id string, action TaskAction, metadata string) (string, error)
func (*PostgresStorage) DeleteInstance ¶
func (b *PostgresStorage) DeleteInstance(dbInstance *DbInstance) error
func (*PostgresStorage) DeleteReplica ¶
func (b *PostgresStorage) DeleteReplica(dbInstance *DbInstance) error
func (*PostgresStorage) DeleteRole ¶
func (b *PostgresStorage) DeleteRole(dbInstance *DbInstance, username string) error
func (*PostgresStorage) GetInstance ¶
func (b *PostgresStorage) GetInstance(Id string) (*DbEntry, error)
func (*PostgresStorage) GetPlanByID ¶
func (b *PostgresStorage) GetPlanByID(planId string) (*ProviderPlan, error)
func (*PostgresStorage) GetPlans ¶
func (b *PostgresStorage) GetPlans(serviceId string) ([]ProviderPlan, error)
func (*PostgresStorage) GetReplicas ¶
func (b *PostgresStorage) GetReplicas(dbInstance *DbInstance) (DatabaseUrlSpec, error)
func (*PostgresStorage) GetRole ¶
func (b *PostgresStorage) GetRole(dbInstance *DbInstance, r string) (DatabaseUrlSpec, error)
func (*PostgresStorage) GetServices ¶
func (b *PostgresStorage) GetServices() ([]osb.Service, error)
func (*PostgresStorage) GetUnclaimedInstance ¶
func (b *PostgresStorage) GetUnclaimedInstance(PlanId string, InstanceId string) (*DbEntry, error)
func (*PostgresStorage) HasReplicas ¶
func (b *PostgresStorage) HasReplicas(dbInstance *DbInstance) (int64, error)
func (*PostgresStorage) HasRole ¶
func (b *PostgresStorage) HasRole(dbInstance *DbInstance, username string) (int64, error)
func (*PostgresStorage) IsRestoring ¶
func (b *PostgresStorage) IsRestoring(dbId string) (bool, error)
func (*PostgresStorage) IsUpgrading ¶
func (b *PostgresStorage) IsUpgrading(dbId string) (bool, error)
func (*PostgresStorage) ListRoles ¶
func (b *PostgresStorage) ListRoles(dbInstance *DbInstance) ([]DatabaseUrlSpec, error)
func (*PostgresStorage) NukeInstance ¶
func (b *PostgresStorage) NukeInstance(Id string) error
func (*PostgresStorage) PopPendingTask ¶
func (b *PostgresStorage) PopPendingTask() (*Task, error)
func (*PostgresStorage) ReturnClaimedInstance ¶
func (b *PostgresStorage) ReturnClaimedInstance(Id string) error
func (*PostgresStorage) StartProvisioningTasks ¶
func (b *PostgresStorage) StartProvisioningTasks() ([]DbEntry, error)
func (*PostgresStorage) UpdateInstance ¶
func (b *PostgresStorage) UpdateInstance(dbInstance *DbInstance, PlanId string) error
func (*PostgresStorage) UpdateReplica ¶
func (b *PostgresStorage) UpdateReplica(dbInstance *DbInstance) error
func (*PostgresStorage) UpdateRole ¶
func (b *PostgresStorage) UpdateRole(dbInstance *DbInstance, username string, password string) (DatabaseUrlSpec, error)
func (*PostgresStorage) UpdateTask ¶
func (*PostgresStorage) ValidateInstanceID ¶
func (b *PostgresStorage) ValidateInstanceID(id string) error
ValidateInstanceID(string)
This is used to ensure that the instance ID being requested to be created is a valid instance id that we can use, it can either check to ensure its not already an existing instance or that the id doesn't contain invalid characters.
func (*PostgresStorage) WarnOnUnfinishedTasks ¶
func (b *PostgresStorage) WarnOnUnfinishedTasks()
type Provider ¶
type Provider interface { GetInstance(string, *ProviderPlan) (*DbInstance, error) Provision(string, *ProviderPlan, string) (*DbInstance, error) Deprovision(*DbInstance, bool) error Modify(*DbInstance, *ProviderPlan) (*DbInstance, error) Tag(*DbInstance, string, string) error Untag(*DbInstance, string) error GetBackup(*DbInstance, string) (DatabaseBackupSpec, error) ListBackups(*DbInstance) ([]DatabaseBackupSpec, error) CreateBackup(*DbInstance) (DatabaseBackupSpec, error) RestoreBackup(*DbInstance, string) error Restart(*DbInstance) error ListLogs(*DbInstance) ([]DatabaseLogs, error) GetLogs(*DbInstance, string) (string, error) CreateReadOnlyUser(*DbInstance) (DatabaseUrlSpec, error) DeleteReadOnlyUser(*DbInstance, string) error RotatePasswordReadOnlyUser(*DbInstance, string) (DatabaseUrlSpec, error) CreateReadReplica(*DbInstance) (*DbInstance, error) GetReadReplica(*DbInstance) (*DbInstance, error) DeleteReadReplica(*DbInstance) error PerformPostProvision(*DbInstance) (*DbInstance, error) }
func GetProviderByPlan ¶
func GetProviderByPlan(namePrefix string, plan *ProviderPlan) (Provider, error)
type ProviderPlan ¶
type RestoreDbTaskMetadata ¶
type RestoreDbTaskMetadata struct {
Backup string `json:"backup"`
}
type Storage ¶
type Storage interface { GetPlans(string) ([]ProviderPlan, error) GetPlanByID(string) (*ProviderPlan, error) GetReplicas(*DbInstance) (DatabaseUrlSpec, error) HasReplicas(*DbInstance) (int64, error) AddReplica(*DbInstance) error UpdateReplica(*DbInstance) error DeleteReplica(*DbInstance) error ListRoles(*DbInstance) ([]DatabaseUrlSpec, error) GetRole(*DbInstance, string) (DatabaseUrlSpec, error) AddRole(*DbInstance, string, string) (DatabaseUrlSpec, error) UpdateRole(*DbInstance, string, string) (DatabaseUrlSpec, error) HasRole(*DbInstance, string) (int64, error) DeleteRole(*DbInstance, string) error GetInstance(string) (*DbEntry, error) AddInstance(*DbInstance) error DeleteInstance(*DbInstance) error UpdateInstance(*DbInstance, string) error AddTask(string, TaskAction, string) (string, error) GetServices() ([]osb.Service, error) UpdateTask(string, *string, *int64, *string, *string, *time.Time, *time.Time) error PopPendingTask() (*Task, error) GetUnclaimedInstance(string, string) (*DbEntry, error) ReturnClaimedInstance(string) error StartProvisioningTasks() ([]DbEntry, error) NukeInstance(string) error WarnOnUnfinishedTasks() IsRestoring(string) (bool, error) IsUpgrading(string) (bool, error) ValidateInstanceID(id string) error }
type TaskAction ¶
type TaskAction string
const ( DeleteTask TaskAction = "delete" ResyncFromProviderTask TaskAction = "resync-from-provider" ResyncFromProviderUntilAvailableTask TaskAction = "resync-until-available" NotifyCreateServiceWebhookTask TaskAction = "notify-create-service-webhook" NotifyCreateBindingWebhookTask TaskAction = "notify-create-binding-webhook" ChangeProvidersTask TaskAction = "change-providers" ChangePlansTask TaskAction = "change-plans" RestoreDbTask TaskAction = "restore-database" PerformPostProvisionTask TaskAction = "perform-post-provision" ResyncReplicasFromProviderTask TaskAction = "resync-replicas-from-provider-task" )