package rcli

import "github.com/dotcloud/docker/rcli"

Index

Constants

const ARG_URL_KEY = "q"

Use this key to encode an RPC call into an URL, eg. domain.tld/path/to/method?q=get_user&q=gordon

Variables

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

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

Functions

func Call

func Call(proto, addr string, args ...string) (*net.TCPConn, 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.

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 ListenAndServeHTTP

func ListenAndServeHTTP(addr string, service Service) error

func LocalCall

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

func Serve

func Serve(conn io.ReadWriter, service Service) error

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

func Subcmd

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

func URLToCall

func URLToCall(u *url.URL) (method string, args []string)

Types

type AutoFlush

type AutoFlush struct {
	http.ResponseWriter
}

func (*AutoFlush) Write

func (w *AutoFlush) Write(data []byte) (int, error)

type Cmd

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

type CmdMethod

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

type Service

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

Source Files

http.go tcp.go types.go

Version
v0.1.0
Published
Mar 24, 2013
Platform
js/wasm
Imports
14 packages
Last checked
3 minutes ago

Tools for package owners.