miniclient

package
v2.0.0-...-f0b7fcc Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_MAX = 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {

	// Set the Pager to use for long output messages
	Pager minipager.Pager
	// contains filtered or unexported fields
}

func Dial

func Dial(base string) (*Conn, error)

func (*Conn) Attach

func (mm *Conn) Attach(namespace string)

Attach creates a CLI interface to the dialed minimega instance

func (*Conn) Close

func (mm *Conn) Close() error

func (*Conn) Error

func (mm *Conn) Error() error

func (*Conn) Pipe

func (mm *Conn) Pipe(pipe string) (io.Reader, io.WriteCloser)

Read or write to a named pipe.

func (*Conn) Run

func (mm *Conn) Run(cmd string) chan *Response

Run a command through a JSON pipe, hand back channel for responses.

func (*Conn) RunAndPrint

func (mm *Conn) RunAndPrint(cmd string, page bool)

Run a command and print the response.

func (*Conn) Suggest

func (mm *Conn) Suggest(input string) []string

type Request

type Request struct {
	Command   string
	Suggest   string
	PlumbPipe string
}

Request sent to minimega -- ethier a command to run or a string to return suggestions for

type Response

type Response struct {
	// Resp, Rendered, More are returned in response to a command
	Resp     minicli.Responses
	Rendered string
	More     bool // whether there are more responses coming

	// Status is set if responding with status update for command (Rendered will
	// contain the status message).
	Status bool

	// Suggest is returned in response to Suggest request
	Suggest []string `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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