rcli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2013 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLIENT_SOCKET io.Writer = nil
View Source
var DEBUG_FLAG bool = false

Note: the globals are here to avoid import cycle FIXME: Handle debug levels mode?

View Source
var UnknownDockerProto = fmt.Errorf("Only TCP is actually supported by Docker at the moment")

Functions

func ListenAndServe

func ListenAndServe(proto, addr string, service Service) error

Listen on `addr`, using protocol `proto`, for incoming rcli calls, and pass them to `service`.

func LocalCall

func LocalCall(service Service, stdin io.ReadCloser, stdout DockerConn, args ...string) error

func RestoreTerminal added in v0.1.4

func RestoreTerminal(state *term.State)

func Serve

func Serve(conn DockerConn, service Service) error

Parse an rcli call on a new connection, and pass it to `service` if it is valid.

func SetRawTerminal added in v0.1.4

func SetRawTerminal() (*term.State, error)

FIXME: move these function to utils.go (in rcli to avoid import loop)

func Subcmd

func Subcmd(output io.Writer, name, signature, description string) *flag.FlagSet

Types

type Cmd

type Cmd func(io.ReadCloser, io.Writer, ...string) error

type CmdMethod

type CmdMethod func(Service, io.ReadCloser, io.Writer, ...string) error

type DockerConn added in v0.1.4

type DockerConn interface {
	io.ReadWriteCloser
	CloseWrite() error
	CloseRead() error
	GetOptions() *DockerConnOptions
	SetOptionRawTerminal()
	Flush() error
}

func Call

func Call(proto, addr string, args ...string) (DockerConn, error)

Connect to a remote endpoint using protocol `proto` and address `addr`, issue a single call, and return the result. `proto` may be "tcp", "unix", etc. See the `net` package for available protocols.

type DockerConnOptions added in v0.1.4

type DockerConnOptions struct {
	RawTerminal bool
}

type DockerLocalConn added in v0.1.4

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

func NewDockerLocalConn added in v0.1.4

func NewDockerLocalConn(w io.WriteCloser) *DockerLocalConn

func (*DockerLocalConn) Close added in v0.1.4

func (c *DockerLocalConn) Close() error

func (*DockerLocalConn) CloseRead added in v0.1.4

func (c *DockerLocalConn) CloseRead() error

func (*DockerLocalConn) CloseWrite added in v0.1.4

func (c *DockerLocalConn) CloseWrite() error

func (*DockerLocalConn) Flush added in v0.1.4

func (c *DockerLocalConn) Flush() error

func (*DockerLocalConn) GetOptions added in v0.1.4

func (c *DockerLocalConn) GetOptions() *DockerConnOptions

func (*DockerLocalConn) Read added in v0.1.4

func (c *DockerLocalConn) Read(b []byte) (int, error)

func (*DockerLocalConn) SetOptionRawTerminal added in v0.1.4

func (c *DockerLocalConn) SetOptionRawTerminal()

func (*DockerLocalConn) Write added in v0.1.4

func (c *DockerLocalConn) Write(b []byte) (int, error)

type DockerTCPConn added in v0.1.4

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

func NewDockerTCPConn added in v0.1.4

func NewDockerTCPConn(conn *net.TCPConn, client bool) *DockerTCPConn

func (*DockerTCPConn) Close added in v0.1.4

func (c *DockerTCPConn) Close() error

func (*DockerTCPConn) CloseRead added in v0.1.4

func (c *DockerTCPConn) CloseRead() error

func (*DockerTCPConn) CloseWrite added in v0.1.4

func (c *DockerTCPConn) CloseWrite() error

func (*DockerTCPConn) Flush added in v0.1.4

func (c *DockerTCPConn) Flush() error

func (*DockerTCPConn) GetOptions added in v0.1.4

func (c *DockerTCPConn) GetOptions() *DockerConnOptions

func (*DockerTCPConn) Read added in v0.1.4

func (c *DockerTCPConn) Read(b []byte) (int, error)

func (*DockerTCPConn) SetOptionRawTerminal added in v0.1.4

func (c *DockerTCPConn) SetOptionRawTerminal()

func (*DockerTCPConn) Write added in v0.1.4

func (c *DockerTCPConn) Write(b []byte) (int, error)

type Service

type Service interface {
	Name() string
	Help() string
}

Jump to

Keyboard shortcuts

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