cmd

package
v0.0.0-...-912c657 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2014 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Colorfy

func Colorfy(msg string, fontcolor string, background string, effect string) string

func ExtractProgramName

func ExtractProgramName(path string) string

func GetURL

func GetURL(path string) (string, error)

func ShowServicesInstancesList

func ShowServicesInstancesList(b []byte) ([]byte, error)

Types

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(client *http.Client, context *Context, manager *Manager) *Client

func (*Client) Do

func (c *Client) Do(request *http.Request) (*http.Response, error)

type Command

type Command interface {
	Info() *Info
	Run(context *Context, client *Client) error
}

type Context

type Context struct {
	Args   []string
	Stdout io.Writer
	Stderr io.Writer
	Stdin  io.Reader
}

type FlaggedCommand

type FlaggedCommand interface {
	Command
	Flags() *gnuflag.FlagSet
}

type Info

type Info struct {
	Name    string
	MinArgs int
	MaxArgs int
	Usage   string
	Desc    string
}

type Manager

type Manager struct {
	Commands map[string]Command
	// contains filtered or unexported fields
}

func BuildBaseManager

func BuildBaseManager(name, version, versionHeader string) *Manager

func NewManager

func NewManager(name, ver, verHeader string, stdout, stderr io.Writer, stdin io.Reader) *Manager

func (*Manager) Register

func (m *Manager) Register(command Command)

func (*Manager) RegisterTopic

func (m *Manager) RegisterTopic(name, content string)

func (*Manager) Run

func (m *Manager) Run(args []string)

type Row

type Row []string

type ServiceModel

type ServiceModel struct {
	Service   string
	Instances []string
}

type Table

type Table struct {
	Headers Row
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) AddRow

func (t *Table) AddRow(row Row)

func (*Table) Bytes

func (t *Table) Bytes() []byte

func (*Table) Rows

func (t *Table) Rows() int

func (*Table) Sort

func (t *Table) Sort()

Sort sorts the rows in the table using the first column as key.

func (*Table) String

func (t *Table) String() string

Directories

Path Synopsis
crane is a command line tool for service providers/administrators.
crane is a command line tool for service providers/administrators.
tsuru is a command line tool for application developers.
tsuru is a command line tool for application developers.
tsuru-admin is under development.
tsuru-admin is under development.

Jump to

Keyboard shortcuts

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