client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package client provides management of clients for a server

go get github.com/altid/server/client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Active bool
	UUID   uint32
	Aux    interface{}
	// contains filtered or unexported fields
}

Client represents a unique client attatched to a server The Aux can be used to store additional data

func (*Client) Current

func (c *Client) Current() string

Current returns the client's current buffer

func (*Client) History

func (c *Client) History() []string

History returns a list of all visited buffers

func (*Client) Previous

func (c *Client) Previous()

Previous sets the current to the last item in the history if there are no previous buffers, it is set to "none"

func (*Client) SetBuffer

func (c *Client) SetBuffer(buffer string)

SetBuffer updates the client's current buffer if set to "none", it marks it as inactive if buffer was previously inactive, it marks it as active

type Manager

type Manager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Manager is used to represent an overview of all currently connected clients

func (*Manager) Client

func (m *Manager) Client(id uint32) *Client

Client - return for given id or nil If UUID is 0, a new one will be generated

func (*Manager) List

func (m *Manager) List() []*Client

List returns all currently tracked clients

func (*Manager) Remove

func (m *Manager) Remove(uuid uint32) error

Remove a named tab from the internal list

Jump to

Keyboard shortcuts

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