client

package
v0.0.0-...-e3a9e5c Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause, LGPL-2.1, MIT, + 1 more Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenPtyMaster

func OpenPtyMaster() (*os.File, string, error)

func OpenTerminal

func OpenTerminal(input io.Reader, output io.Writer, istty bool) (string, chan struct{}, error)

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

func Dial(sockpath string, debug bool) (*Client, error)

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

func (c *Client) Allowed(path string) ([]string, error)

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

func (c *Client) Children(path string) ([]string, error)

Children takes a '/' separated path and returns a []string containg the the children of a given path.

func (*Client) Close

func (c *Client) Close()

Close the client's connection

func (*Client) Complete

func (c *Client) Complete(path string) ([]string, error)

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

func (c *Client) Expand(path string) ([]string, error)

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) GetPerms

func (c *Client) GetPerms() (map[string]string, error)

GetPerms returns the permissions for the current user

func (*Client) Help

func (c *Client) Help(path string) (map[string]string, error)

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.

func (*Client) Tmpl

func (c *Client) Tmpl(path string) (map[string]string, error)

Tmpl takes a '/' separated path and retruns a map[string]string containg the template (<field>,<value>) pairs.

Jump to

Keyboard shortcuts

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