blueprint

package
v0.0.0-...-0627081 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2016 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DBBucketWatcher defines boltdb bucket for Watcher
	DBBucketWatcher = "Northshore"

	// DBKeyWatcher defines boltdb key for Watcher
	DBKeyWatcher = "containers"

	// DBBucket defines boltdb bucket for blueprints
	DBBucket = "blueprints"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blueprint

type Blueprint struct {
	//API version for processing blueprint
	Version string `json:"version"`
	//Type of blueprint (pipeline/application)
	Type   string           `json:"type"`
	Name   string           `json:"name"`
	Stages map[string]Stage `json:"stages"`
	// State is current Blueprint status
	State State     `json:"state"`
	ID    uuid.UUID `json:"id"`
}

Blueprint represents a Blueprint

func GetByID

func GetByID(id []byte) (bp Blueprint, err error)

GetByID returns one Blueprint

func ParseBytes

func ParseBytes(b []byte) (bp Blueprint, err error)

ParseBytes parses and validates the incoming data

func ParseFile

func ParseFile(path string) (bp Blueprint, err error)

ParseFile parses and validates the incoming data

func (*Blueprint) Delete

func (bp *Blueprint) Delete() error

Delete deletes blueprint with containers

func (Blueprint) GetID

func (bp Blueprint) GetID() string

GetID implements `api2go.MarshalIdentifier` interface

func (*Blueprint) Run

func (bp *Blueprint) Run()

Run creates and starts Docker containers

func (*Blueprint) Save

func (bp *Blueprint) Save() error

Save stores blueprint in db

func (*Blueprint) SetID

func (bp *Blueprint) SetID(id string) (err error)

SetID implements `api2go.UnmarshalIdentifier` interface

type BlueprintsMap

type BlueprintsMap map[string]*Blueprint

BlueprintsMap represents store.Storable collection

func GetBlueprintsMap

func GetBlueprintsMap() (items BlueprintsMap, err error)

GetBlueprintsMap returns collection

func (BlueprintsMap) Bucket

func (items BlueprintsMap) Bucket() []byte

Bucket implements store.Storable interface

func (*BlueprintsMap) Next

func (items *BlueprintsMap) Next(k []byte) interface{}

Next implements store.Storable interface

type BlueprintsSlice

type BlueprintsSlice []*Blueprint

BlueprintsSlice represents store.Storable collection

func GetBlueprintsSlice

func GetBlueprintsSlice() (items BlueprintsSlice, err error)

GetBlueprintsSlice returns collection

func (BlueprintsSlice) Bucket

func (items BlueprintsSlice) Bucket() []byte

Bucket implements store.Storable interface

func (*BlueprintsSlice) Next

func (items *BlueprintsSlice) Next([]byte) interface{}

Next implements store.Storable interface

type Stage

type Stage struct {
	//Docker image for bootstrap stage
	Image       string `json:"image"`
	Description string `json:"description"`
	//Ports for exposing to host
	Ports []map[string]string `json:"ports"`
	//Environment variables
	Variables map[string]string `json:"variables"`
	//Provisioner type (docker/...)
	Provisioner string `json:"provisioner"`
	// State is current Blueprint status
	State StageState `json:"state"`
}

Stage represents a Blueprint Stage

type StageState

type StageState string

StageState represents a state of the Stage

const (
	// StageStateNew is default state of the Stage
	StageStateNew StageState = "new"
	// StageStateCreated indicates that container is created
	StageStateCreated StageState = "created"
	// StageStateRunning indicates that container is running
	StageStateRunning StageState = "running"
	// StageStatePaused indicates that container is paused
	StageStatePaused StageState = "paused"
	// StageStateStopped indicates that container is stopped
	StageStateStopped StageState = "stopped"
	// StageStateDeleted indicates that container is deleted
	StageStateDeleted StageState = "deleted"
)

type State

type State string

State represents a state of the Blueprint

const (
	// StateNew is default state of the Blueprint
	StateNew State = "new"
	// StateProvision is the Blueprint status while provisioning
	StateProvision State = "provision"
	// StateActive is the Blueprint status when all Stages are up and ready
	StateActive State = "active"
	// StateInactive is the Blueprint status when some Stage is down
	StateInactive State = "inactive"
)

Jump to

Keyboard shortcuts

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