client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Handlers map[string]func([]byte)
	Wg       *sync.WaitGroup
	// contains filtered or unexported fields
}

Client is a standard plug host. It supports basic operations.

func NewClient

func NewClient(name string) *Client

NewClient returns a pre-setup simple client for a plug.

func (*Client) HandleMessageType

func (h *Client) HandleMessageType(name string, handler func([]byte))

HandleMessageType adds handler for incoming messages from the plug to the host.

func (*Client) Init

func (h *Client) Init()

func (*Client) Kill

func (c *Client) Kill()

Kill demands graceful shutdown of a plug.

func (*Client) Respond

func (h *Client) Respond(t string, v any)

Respond is a basic function for sending message from host to a plug.

func (*Client) RunCommand

func (c *Client) RunCommand(name string, v any)

RunCommand sends arbitrary message to a plug. Plug must understand the message.

func (*Client) SetCommand

func (c *Client) SetCommand(command string)

SetCommand is

func (*Client) StartLocal

func (c *Client) StartLocal()

StartLocal starts local plug

Jump to

Keyboard shortcuts

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