client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 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)
	// 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 (c *Client) HandleMessageType(name string, handler func([]byte))

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

func (*Client) Kill

func (c *Client) Kill() error

Kill demands graceful shutdown of a plug.

func (*Client) RespondRaw added in v0.0.3

func (c *Client) RespondRaw(t string, v any) error

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

func (*Client) RunCommand

func (c *Client) RunCommand(name codes.MessageCode, v any) (codes.PluginExitReason, error)

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

func (*Client) SetCommand

func (c *Client) SetCommand(command string)

SetCommand sets plug executable name

func (*Client) StartLocal

func (c *Client) StartLocal() error

StartLocal starts local plug

Jump to

Keyboard shortcuts

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