base

package
v0.0.0-...-154e0e3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2016 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	// CreateInstance uses the catalog and parsed request to create an instance for the particular type of service.
	CreateInstance(*catalog.Catalog, string, request.Request) response.Response
	// BindInstance takes the existing instance and binds it to an app.
	BindInstance(*catalog.Catalog, string, Instance) response.Response
	// DeleteInstance deletes the existing instance.
	DeleteInstance(*catalog.Catalog, string, Instance) response.Response
}

Broker is the interface that every type of broker should implement.

type Instance

type Instance struct {
	Uuid string `gorm:"primary_key" sql:"type:varchar(255) PRIMARY KEY"`

	request.Request

	Host string `sql:"size(255)"`
	Port int64

	State InstanceState

	CreatedAt time.Time
	UpdatedAt time.Time
}

func FindBaseInstance

func FindBaseInstance(brokerDb *gorm.DB, id string) (Instance, response.Response)

FindBaseInstance is a helper function to find the base instance of the

type InstanceState

type InstanceState uint8

InstanceState is an enumeration to indicate what state the instance is in.

const (
	// InstanceNotCreated is the default InstanceState that represents an uninitiated instance.
	InstanceNotCreated InstanceState = iota // 0
	// InstanceInProgress indicates that the instance is in a intermediate step.
	InstanceInProgress // 1
	// InstanceReady indicates that the instance is created and ready to be used.
	InstanceReady // 2
	// InstanceGone indicates that the instance is deleted.
	InstanceGone // 3
	// InstanceNotGone indicates that the instance is successfully deleted.
	InstanceNotGone // 4
)

Jump to

Keyboard shortcuts

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