client

package
v0.0.1-config Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MSIZE = p.MSIZE

MSIZE - maximum size for a message

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a 9p client session

func NewClient

func NewClient(addr string) *Client

NewClient returns a client ready to connect to addr

func NewMockClient

func NewMockClient(addr string) *Client

NewMockClient returns a client for testing Feed, if called, will be populated with data from google's GoFuzz every 100ms

func (*Client) Aside

func (c *Client) Aside() ([]byte, error)

Aside returns the contents of the `aside` file for a given buffer

func (*Client) Attach

func (c *Client) Attach() (err error)

Attach is called after optionally calling Auth

func (*Client) Auth

func (c *Client) Auth() error

Auth is optionally called after Connect to authenticate with the server

func (*Client) Buffer

func (c *Client) Buffer(name string) (int, error)

Buffer changes the active buffer to the named buffer, or returns an error

func (*Client) Cleanup

func (c *Client) Cleanup()

Cleanup closes the underlying connection

func (*Client) Close

func (c *Client) Close(name string) (int, error)

Close attempts to close the named buffer

func (*Client) Command

func (c *Client) Command(cmd *fs.Command) error

Command sends the named command to the service If command is invalid, it will return an error

func (*Client) Connect

func (c *Client) Connect(debug int) (err error)

Connect performs the network dial for the connection

func (*Client) Document

func (c *Client) Document() ([]byte, error)

Document returns the contents of a document file on the host if it exists, or an error

func (*Client) Feed

func (c *Client) Feed() (io.ReadCloser, error)

Feed returns a ReadCloser connected to `feed`. It's expected all reads will be read into a buffer with a size of MSIZE It is also expected for Feed to be called in its own thread

func (*Client) FeedIterator

func (c *Client) FeedIterator() (*FeedIterator, error)

FeedIterator returns a new FeedIterator ready to go

func (*Client) GetCommands

func (c *Client) GetCommands() ([]*fs.Command, error)

GetCommands returns a list of available commands for the connected service

func (*Client) Input

func (c *Client) Input(data []byte) (int, error)

Input appends the given data string to input

func (c *Client) Link(from, to string) (int, error)

Link updates the current buffer to point to the `to`

func (*Client) Notifications

func (c *Client) Notifications() ([]byte, error)

Notifications returns and clears any pending notifications

func (*Client) Open

func (c *Client) Open(name string) (int, error)

Open attempts to open the named buffer

func (*Client) Status

func (c *Client) Status() ([]byte, error)

Status returns the contents of the `status` file for a given buffer

func (*Client) Tabs

func (c *Client) Tabs() ([]byte, error)

Tabs returns the contents of the `tabs` file for the server

func (*Client) Title

func (c *Client) Title() ([]byte, error)

Title returns the contents of the `title` file for a given buffer

type FeedIterator

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

FeedIterator allows you to step through lines of feed with Next() Useful for gomobile, etc

func (*FeedIterator) Next

func (f *FeedIterator) Next() ([]byte, error)

Next will return the next slice of bytes, or an error After an error, future calls to Next() will panic

Directories

Path Synopsis
cmd
altid-cli command
internal

Jump to

Keyboard shortcuts

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