Documentation ¶
Index ¶
- func OpenPtyMaster() (*os.File, string, error)
- func OpenTerminal(input io.Reader, output io.Writer, istty bool) (string, chan struct{}, error)
- type Client
- func (c *Client) Allowed(path string) ([]string, error)
- func (c *Client) Children(path string) ([]string, error)
- func (c *Client) Close()
- func (c *Client) Complete(path string) ([]string, error)
- func (c *Client) Expand(path string) ([]string, error)
- func (c *Client) GetPerms() (map[string]string, error)
- func (c *Client) Help(path string) (map[string]string, error)
- func (c *Client) Run(path string, env []string, tty bool, input io.Reader, output io.Writer) (int, error)
- func (c *Client) Tmpl(path string) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an RPC client calls against the client stub functions are sent to the server to be fulfilled and a response of the appropriate type is returned.
func Dial ¶
Dial connects to an RPC server at the specified path. Only unix sockets are supported since we use SO_PEERCRED to do authorization.
func (*Client) Allowed ¶
Allowed takes a '/' separated path and retruns a []string containg the allowed values for a tag node, or an error if called on a non tag node.
func (*Client) Children ¶
Children takes a '/' separated path and returns a []string containg the the children of a given path.
func (*Client) Complete ¶
Complete takes a '/' separated path and returns a list of possible completions.It is the client implementation's job to prefix filter this list. This is a convenience for the CLI bash implementation. It does in one call what would take several using the other methods, and may be useful for other user interfaces.
func (*Client) Expand ¶
Expand takes a '/' separated path and returns the unambiguous expansion of that path; [sh int e eth0] will become [show interfaces ethernet eth0] for instance. If the given path is invalid or, ambiguous an error message will be returned.
func (*Client) Help ¶
Help takes a '/' separated path and returns a map of completions and their help text. It is the client implementation's job to prefix filter this list.This is a convenience for the CLI bash implementation. It does in one call what would take several using the other methods, and may be useful for other user interfaces.
func (*Client) Run ¶
func (c *Client) Run(path string, env []string, tty bool, input io.Reader, output io.Writer) (int, error)
Run takes a '/' separated path, the type of the connecting terminal (typically this is the TERM environment variable) , the number of rows and cols in the connecting terminal, and returns the remote exitcode or 1 on error.