client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintErr

func PrintErr(err string)

PrintErr formats an application error.

func PrintUsageAndExit

func PrintUsageAndExit()

PrintUsageAndExit is used to print out command line options.

func PrintVersionAndExit

func PrintVersionAndExit()

PrintVersionAndExit prints the version of the server then exits.

Types

type Client

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

Client represents an instance of a connection to the server.

func New

func New(o *Options) *Client

New is a factory function that returns a new client instance.

func (*Client) Execute

func (c *Client) Execute() (string, error)

Execute communicates to the server with an action.

type Options

type Options struct {
	Name             string `json:"name"`             // The name of the service to deploy.
	Version          string `json:"version"`          // The version of the service.
	ImageVersion     string `json:"imageVersion"`     // The version of the docker image.
	NumInstances     int    `json:"numInstances"`     // The number of instances to deploy.
	TemplateFilePath string `json:"templateFilePath"` // The path to the unit .service file source file.
	Etcd2FilePath    string `json:"etcd2FilePath"`    // The path to the etcd2 key/value source file.
	Token            string `json:"bearerToken"`      // The API authorization token to the server.
	Url              string `json:"URL"`              // The URL to the coreos-deploy endpoint.
	DeployID         string `json:"deployID"`         // The Deploy ID to query.
	Debug            bool   `json:"debugEnabled"`     // Is debugging enabled in the application?
}

Options represents parameters that are passed to the application.

func (*Options) String

func (o *Options) String() string

String is an implentation of the Stringer interface so the structure is returned as a string to fmt.Print() etc.

func (*Options) Validate

func (o *Options) Validate() error

Validate options

type ServiceTemplateVars

type ServiceTemplateVars struct {
	Name         string `json:"name"`         // The name of the service to deploy.
	Version      string `json:"version"`      // The version of the service.
	ImageVersion string `json:"imageVersion"` // The version of the docker image.
	NumInstances int    `json:"numInstances"` // The number of instances to deploy.
}

Text template variables to substitute in the .service template.

Jump to

Keyboard shortcuts

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