cli

package
Version: v0.0.0-...-3a95bc3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2014 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// Client is used to communicate with a Pulse server.
	Client func(url, user, pass string) (pulse.Client, error)
	// Dev TODO(rjeczalik): document
	Dev func(c pulse.Client, url, user, pass string) (dev.Tool, error)
	// Out terminates the application, writing to os.Stdout and calling os.Exit(0)
	Out func(...interface{})
	// Err terminates the application, writing to os.Stdout and calling os.Exit(1)
	Err func(...interface{})
	// Store is used to persist authorization information.
	Store CredsStore
	// contains filtered or unexported fields
}

CLI is a facade that implements cmd/pulsecli tool.

func New

func New() *CLI

New gives a new CLI, sets up command line handling and registers subcommands.

func (*CLI) Agents

func (cli *CLI) Agents(ctx *cli.Context)

Agents is a command line interface to a Agents method of a pulse.Client. It prints hostname-agentname pairs one per line for every agent. It tries to extract the hostname from every agent's URL.

func (*CLI) Artifact

func (cli *CLI) Artifact(ctx *cli.Context)

Artifact is a a command line interface to Artifact method of a pulse.Client. It downloads all artifacts captured from given project and build number

func (*CLI) Build

func (cli *CLI) Build(ctx *cli.Context)

Build is a command line interface to a BuildID method of a pulse.Client.

func (*CLI) Clean

func (cli *CLI) Clean(ctx *cli.Context)

Clean is a command line interface o a Clear method of a pulse.Client. It triggers a working directory cleanup for each project requested.

func (*CLI) Health

func (cli *CLI) Health(ctx *cli.Context)

Health checks a status of a Pulse server or a project. Pulse server health check fails when at least one agent is offline (meaning that pulse-agent on that machine has died or communication went down) or at least half of the agents are in synchronization state, which means Pulse server has deadlocked because of whatever reasons (the most favorite is DNS handling, apparently it is possible for a DNS request to not time out, which makes all Pulse worker threads just stuck). A project health check requests error and warning messages for latest build of a given project, and fails when the list is not empty.

func (*CLI) Init

func (cli *CLI) Init(ctx *cli.Context)

Init is a a command line interface to Init method of a pulse.Client. It outputs a pair of boolean and name, one per line for every project requested, separated by a tab. Boolean value indicates whether initialization request was accepted of rejected by Pulse server.

func (*CLI) Login

func (cli *CLI) Login(ctx *cli.Context)

Login writes Pulse Remote API authentication information to a ~/.pulsecli file in a YAML format. On consecutive runs it updates every non-empty field that is passed from command line. It fails in doing so, when given credentials are not valid.

func (*CLI) Personal

func (cli *CLI) Personal(ctx *cli.Context)

Personal TODO(rjeczalik): document

func (*CLI) Projects

func (cli *CLI) Projects(ctx *cli.Context)

Projects is a command line interface to a Projects method of a pulse.Client. It outputs a name for every project, one per line.

func (*CLI) Run

func (cli *CLI) Run(args []string)

Run takes command line arguments and starts the application.

func (*CLI) Stages

func (cli *CLI) Stages(ctx *cli.Context)

Stages is a command line interface to a Stages method of a pulse.Client. It outputs names one per line and expectes an exact project name to be passed through command line, not a regex.

func (*CLI) Status

func (cli *CLI) Status(ctx *cli.Context)

Status is a command line interface to a BuildResult methos of a pulse.Client. It outputs []BuildResult for every requested project in an YAML format.

func (*CLI) Trigger

func (cli *CLI) Trigger(ctx *cli.Context)

Trigger is a command line interface to a Trigger method of a pulse.Client. It outputs pairs of a request ID and a project name one per line, for every project requested. Values are separated by a tab.

func (*CLI) Wait

func (cli *CLI) Wait(ctx *cli.Context)

Wait TODO(rjeczalik): document

type Creds

type Creds struct {
	URL  string
	User string
	Pass string
}

Creds holds information required to authenticate an user session from the Pulse Remote API endpoint.

type CredsStore

type CredsStore interface {
	// Load gives Creds loaded from a persisted storage.
	Load() (*Creds, error)
	// Save saves given Creds to a persisted storage.
	Save(*Creds) error
}

CredsStore persists the Creds struct.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL