api

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exiting = false

Exiting is a flag indicating that the server is exiting

View Source
var WaitGroup sync.WaitGroup

WaitGroup is the wait group to synchronize deployments and job runs

Functions

func AddHandlers

func AddHandlers(s *server.Server)

AddHandlers adds api handlers to the server

Types

type AppResponse

type AppResponse struct {
	Repository     []*docker.Image     `json:"repository,omitempty"`
	DeploymentSpec string              `json:"deploymentSpec,omitempty"`
	ReplicaSet     *v1beta1.ReplicaSet `json:"replicaSet,omitempty"`
	Service        *v1.Service         `json:"service,omitempty"`
}

AppResponse is the response for the app endpoint

type AppsResponse

type AppsResponse struct {
	ReplicaSets map[string]v1beta1.ReplicaSet `json:"replicaSets,omitempty"`
	Services    *v1.ServiceList               `json:"services,omitempty"`
}

AppsResponse is the response for the app endpoint

type Clock

type Clock time.Duration

Clock is a time.Duration struct with custom JSON marshal functions

func (*Clock) MarshalJSON

func (c *Clock) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Clock) UnmarshalJSON

func (c *Clock) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type Deployment

type Deployment struct {
	ID       string    `json:"id"`
	Env      string    `json:"env"`
	App      string    `json:"app"`
	Branch   string    `json:"branch"`
	Tag      string    `json:"tag"`
	Time     time.Time `json:"time"`
	Username string    `json:"username"`
	State    string    `json:"state"`
	Rollout  *Rollout  `json:"rollout,omitempty"`

	Clock           *Clock `json:"clock"`
	DesiredReplicas int    `json:"desiredReplicas"`
	OriginalPods    []Pod  `json:"originalPods"`
	FromPods        []Pod  `json:"fromPods"`
	FromTag         string `json:"fromTag"`
	FromUID         string `json:"fromUid"`

	ToPods []Pod  `json:"toPods"`
	ToUID  string `json:"toUid"`
}

Deployment represents a single deployment of an image for any app

func (*Deployment) Init

func (d *Deployment) Init(env, app, username string, trigger bool) error

Init initializes a deployment, checks to make sure it is valid, and writes the deployment data to firebase

type DeploymentInitError

type DeploymentInitError struct {
	// contains filtered or unexported fields
}

DeploymentInitError is raised if there is a problem initializing a deployment

func (DeploymentInitError) Error

func (e DeploymentInitError) Error() string

type DeploymentScaleRequest added in v1.1.0

type DeploymentScaleRequest struct {
	Replicas *int `json:"replicas"`
}

DeploymentScaleRequest is a request to scale a deployment

type EnvironmentCreateRequest added in v1.1.0

type EnvironmentCreateRequest struct {
	Name   string `json:"name"`
	Branch string `json:"branch"`
	Spec   string `json:"spec"`
}

EnvironmentCreateRequest is a request to create a new environment

type JobResponse

type JobResponse struct {
	Repository []*docker.Image `json:"repository,omitempty"`
	PodSpec    string          `json:"podSpec,omitempty"`
}

JobResponse is the response for the job endpoint

type LogMessage

type LogMessage struct {
	Time    time.Time `json:"time"`
	Message string    `json:"msg"`
	Level   string    `json:"level"`
}

LogMessage is a wrapper for log messages in the db

type Pod

type Pod struct {
	Name    string    `json:"name"`
	Created time.Time `json:"created"`
	Phase   string    `json:"phase"`
	Ready   bool      `json:"ready"`
	Host    string    `json:"host"`
}

Pod is a summary of the state of a kubernetes pod

type Release

type Release struct {
	URL      string    `json:"url,omitempty"`
	Time     time.Time `json:"time"`
	Username string    `json:"username"`
	Approved bool      `json:"approved"`
}

Release is an object representing an image tag for release

type Rollout

type Rollout struct {
	Strategy string `json:"strategy"`
}

Rollout is the description of how the deployment will be rolled out TODO: support MaxUnavailable and MaxSurge for rolling updates

type Run

type Run struct {
	ID       string    `json:"id"`
	Branch   string    `json:"branch"`
	Tag      string    `json:"tag"`
	Time     time.Time `json:"time"`
	Username string    `json:"username"`
	State    string    `json:"state"`

	Clock *Clock `json:"clock"`

	UID string `json:"uid"`
}

Run represents a single run of an image for any job

func (*Run) Init

func (r *Run) Init(env, job, username string, trigger bool) error

Init initializes a job run, checks to make sure it is valid, and writes the run data to firebase

type RunInitError

type RunInitError struct {
	// contains filtered or unexported fields
}

RunInitError is raised if there is a problem initializing a run

func (RunInitError) Error

func (e RunInitError) Error() string

Jump to

Keyboard shortcuts

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