actions

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package actions contains the actions that the CLI can take. cmdr.Commands get user input, and then drive the actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Do() error
}

An Action is used to Do things.

type AddArtifact

type AddArtifact struct {
	Repo        string
	Offset      string
	Tag         string
	DockerImage string
	LocalShell  shell.Shell
	LogSink     logging.LogSink
	User        sous.User
	Inserter    sous.ClientInserter
	*config.Config
}

AddArtifact struct for add artifact action.

func (*AddArtifact) Do

func (a *AddArtifact) Do() error

Do executes the action for add artifact.

func (*AddArtifact) UploadArtifact

func (a *AddArtifact) UploadArtifact(versionName, digestName string) error

UploadArtifact add artifact to sous servers

type Build

type Build struct {
	GetArtifact  *GetArtifact
	BuildManager *sous.BuildManager
	RFF          *sous.ResolveFilter
	CLIArgs      []string
	// contains filtered or unexported fields
}

Build handles building deployable artifacts.

func (*Build) Do

func (sb *Build) Do() error

Do performs the build.

func (*Build) Result

func (sb *Build) Result() *sous.BuildResult

Result returns the result of this build.

type Deploy

type Deploy struct {
	ResolveFilter      *sous.ResolveFilter
	StateReader        sous.StateReader
	HTTPClient         restful.HTTPClient
	TargetDeploymentID sous.DeploymentID
	LogSink            logging.LogSink
	User               sous.User
	Force, WaitStable  bool
	*config.Config
}

Deploy is used to issue the command to make a new Deployment current for it's SourceID.

func (*Deploy) Do

func (sd *Deploy) Do() error

Do implements Action on Deploy.

type GetArtifact

type GetArtifact struct {
	Query             queries.ArtifactQuery
	Repo, Offset, Tag string
	LogSink           logging.LogSink
	BuildArtifact     sous.BuildArtifact
}

GetArtifact struct for add artifact action.

func (*GetArtifact) ArtifactExists

func (a *GetArtifact) ArtifactExists() (bool, error)

ArtifactExists returns (true, nil) if the artifact exists, (false, nil) it the artifact does not exist and (undefined, error) if the check is not successful.

func (*GetArtifact) Do

func (a *GetArtifact) Do() error

Do executes the action for add artifact.

type Jenkins

type Jenkins struct {
	HTTPClient       restful.HTTPClient
	TargetManifestID sous.ManifestID
	LogSink          logging.LogSink
	User             sous.User
	Cluster          string
	*config.Config
}

Jenkins is used to issue the command to make a new Deployment current for it's SourceID.

func (*Jenkins) Do

func (sj *Jenkins) Do() error

Do implements Action on Jenkins.

type ManifestGet

type ManifestGet struct {
	ResolveFilter    *sous.ResolveFilter
	TargetManifestID sous.ManifestID
	HTTPClient       restful.HTTPClient
	LogSink          logging.LogSink
	OutWriter        io.Writer
	UpdaterCapture   *restful.Updater
}

A ManifestGet is an Action that fetches a manifest.

func (*ManifestGet) Do

func (mg *ManifestGet) Do() error

Do implements Action on ManifestGet.

func (*ManifestGet) GetManifest

func (mg *ManifestGet) GetManifest() (sous.Manifest, error)

GetManifest returns the sous.Manifest.

type ManifestSet

type ManifestSet struct {
	sous.ManifestID
	InReader      io.Reader
	ResolveFilter *sous.ResolveFilter
	logging.LogSink
	User    sous.User
	Updater *restful.Updater
}

ManifestSet is an Action for setting a manifest.

func (*ManifestSet) Do

func (ms *ManifestSet) Do() error

Do implements the Action interface on ManifestSet

func (*ManifestSet) SetManifest

func (ms *ManifestSet) SetManifest(m sous.Manifest) error

SetManifest sets the manifest.

type PlumbNormalizeGDM

type PlumbNormalizeGDM struct {
	Log           logging.LogSink
	StateLocation string
	User          sous.User
}

PlumbNormalizeGDM struct for normalize GDM action.

func (*PlumbNormalizeGDM) Do

func (p *PlumbNormalizeGDM) Do() error

Do executes the action for plumb normalize GDM.

type PollStatus

type PollStatus struct {
	StatusPoller *sous.StatusPoller
}

PollStatus manages the command to poll the server for status.

func (*PollStatus) Do

func (ps *PollStatus) Do() error

Do implements Action on PollStatus.

type Rectify

type Rectify struct {
	Resolver *sous.Resolver
	State    *sous.State
	Log      logging.LogSink
}

Rectify processes a workstation rectify command. Mostly deprecated by sous server, but very useful when it is.

func (*Rectify) Do

func (sr *Rectify) Do() error

Do implements Action on Rectify.

type Server

type Server struct {
	Version           semv.Version
	DeployFilterFlags config.DeployFilterFlags `inject:"optional"`
	Log               logging.LogSink

	ListenAddr string
	GDMRepo    string

	*config.Config
	ServerHandler http.Handler
	*sous.AutoResolver
}

A Server represents the `sous server` command.

func (*Server) Do

func (ss *Server) Do() error

Do runs the server.

type Update

type Update struct {
	Manifest         *sous.Manifest
	GDM              sous.Deployments
	HTTPStateManager *sous.HTTPStateManager
	ResolveFilter    *sous.ResolveFilter
	User             sous.User
	Log              logging.LogSink
}

Update is the command description for `sous update`

func (*Update) Do

func (u *Update) Do() error

Do performs the appropriate update, returning nil on success.

Jump to

Keyboard shortcuts

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