pool

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveLayout

func SaveLayout(layout Layout) error

SaveLayout stores layout to a local json file

Types

type Layout

type Layout struct {
	Name string
	List []types.API
}

Layout of multiple Sockets Each layout is stored serverside to be retrieved later by the client

func LoadLayout

func LoadLayout(name string) Layout

LoadLayout returns the stored layout of the given name

type Pool

type Pool struct {
	Map map[uuid.UUID]types.API

	ImageDB *types.ImageDB
	// contains filtered or unexported fields
}

Pool holds multiple apis and handles registration and deletion

func NewPool

func NewPool() *Pool

NewPool generates a new pool

func (*Pool) Add

func (pool *Pool) Add(apiName string, id uuid.UUID, sockets map[types.Socket]bool) (types.API, error)

Add a new API to the pool

func (*Pool) GetImageDB

func (pool *Pool) GetImageDB() *types.ImageDB

func (*Pool) List

func (pool *Pool) List() []types.API

List turns map into list

func (*Pool) Register

func (pool *Pool) Register(a types.API)

Register a new API

func (*Pool) Save

func (pool *Pool) Save()

Save the current state of the pool

func (*Pool) SaveImageDB

func (pool *Pool) SaveImageDB()

func (*Pool) Switch

func (pool *Pool) Switch(a types.API, message types.ClientMessage) error

Switch from one API type to another, while maintaining the same socket

func (*Pool) Unregister

func (pool *Pool) Unregister(data types.Unregister)

Unregister a new API

Jump to

Keyboard shortcuts

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