utils

package
v0.0.0-...-8488f5b Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2016 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppNamePattern = regexp.MustCompile(`^[a-z\d]+(-[a-z\d]+)*$`)

Functions

func ClusterClientWrapper

func ClusterClientWrapper(c *cluster.Client) clusterClientWrapper

func ExpandFormation

func ExpandFormation(c ControllerClient, f *ct.Formation) (*ct.ExpandedFormation, error)

func FormationTagsEqual

func FormationTagsEqual(a, b map[string]map[string]string) bool

func JobConfig

func JobConfig(f *ct.ExpandedFormation, name, hostID string, uuid string) *host.Job

func JobMetaFromMetadata

func JobMetaFromMetadata(metadata map[string]string) map[string]string

func ProvisionVolume

func ProvisionVolume(h VolumeCreator, job *host.Job) error

Types

type ClusterClient

type ClusterClient interface {
	Host(string) (HostClient, error)
	Hosts() ([]HostClient, error)
	StreamHostEvents(chan *discoverd.Event) (stream.Stream, error)
}

type ControllerClient

type ControllerClient interface {
	GetApp(appID string) (*ct.App, error)
	GetRelease(releaseID string) (*ct.Release, error)
	GetArtifact(artifactID string) (*ct.Artifact, error)
	GetExpandedFormation(appID, releaseID string) (*ct.ExpandedFormation, error)
	CreateApp(app *ct.App) error
	CreateRelease(release *ct.Release) error
	CreateArtifact(artifact *ct.Artifact) error
	PutFormation(formation *ct.Formation) error
	StreamFormations(since *time.Time, ch chan<- *ct.ExpandedFormation) (stream.Stream, error)
	AppList() ([]*ct.App, error)
	FormationListActive() ([]*ct.ExpandedFormation, error)
	PutJob(*ct.Job) error
	JobListActive() ([]*ct.Job, error)
}

type FormationKey

type FormationKey struct {
	AppID, ReleaseID string
}

func NewFormationKey

func NewFormationKey(appID, releaseID string) FormationKey

func (FormationKey) String

func (f FormationKey) String() string

type HostClient

type HostClient interface {
	VolumeCreator
	ID() string
	Tags() map[string]string
	AddJob(*host.Job) error
	GetJob(id string) (*host.ActiveJob, error)
	Attach(*host.AttachReq, bool) (cluster.AttachClient, error)
	StopJob(string) error
	ListJobs() (map[string]host.ActiveJob, error)
	StreamEvents(id string, ch chan *host.Event) (stream.Stream, error)
	GetStatus() (*host.HostStatus, error)
}

type VolumeCreator

type VolumeCreator interface {
	CreateVolume(string) (*volume.Info, error)
}

Jump to

Keyboard shortcuts

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