remote

package
v0.0.0-...-27f5e65 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(addr, tlsCert, tlsKey, tlsCACert string, insecureSkipVerify bool) (api.ExtClient, error)

Dial creates a mutually authenticated grpc connection that's given directly to NewClient.

If tlsCert and tlsKey are present they will be used as the client's certificates and tls is turned on. If tlsCACert is present it will use that certificate instead of the system wide CA certificates. And finally if insecureSkipVerify is on it will not verify the server's certificate.

Types

type Client

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

Client helps handle event and command dispatching remotely.

func NewClient

func NewClient(extension string, client api.ExtClient) *Client

NewClient returns a new dispatcher for extensions.

func (*Client) Listen

func (c *Client) Listen() error

Listen for events and commands and dispatch them to handlers. It blocks forever on its two listening goroutines.

func (*Client) Register

func (c *Client) Register(network string, channel string, event string, handler dispatch.Handler) (uint64, error)

Register an event handler with the bot

func (*Client) RegisterCmd

func (c *Client) RegisterCmd(network string, channel string, command *cmd.Command) (uint64, error)

RegisterCmd with the bot

func (*Client) Unregister

func (c *Client) Unregister(id uint64) (bool, error)

Unregister an event handler

func (*Client) UnregisterCmd

func (c *Client) UnregisterCmd(id uint64) (bool, error)

UnregisterCmd from the bot

Jump to

Keyboard shortcuts

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