client

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidClientID = errors.New("invalid clientID")

Functions

func FixedDelay added in v0.1.4

func FixedDelay(delay int) func()

func ManualSuccession added in v0.1.4

func ManualSuccession(cancel context.CancelFunc) func()

func RandomDelay added in v0.1.4

func RandomDelay(delay int) func()

Types

type Client

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

func NewClient

func NewClient(address string, opts ...Option) *Client

func (*Client) Connect added in v0.1.3

func (s *Client) Connect() error

func (*Client) Emit

func (s *Client) Emit(ctx context.Context, event es.Event) (es.Event, error)

func (*Client) PlayEvents added in v0.1.4

func (s *Client) PlayEvents(ctx context.Context, events []base.Event, delay func(), progress func())

func (*Client) PrintServerState added in v0.1.2

func (s *Client) PrintServerState(ctx context.Context)

func (*Client) Stream

func (s *Client) Stream(ctx context.Context, selector *es.Selector, bracket *es.Bracket, handler es.EventHandler) (int64, error)

func (*Client) Subscribe

func (s *Client) Subscribe(ctx context.Context, clientID string, sel *es.Selector, handler es.EventHandler) error

type Formatter

type Formatter func(w io.Writer, e *es.Event) error

func JsonFormatter

func JsonFormatter(pretty bool) Formatter

func OmitPayload

func OmitPayload(f Formatter) Formatter

func TextFormatter

func TextFormatter(color bool) Formatter

type Option

type Option = func(c *Client)

func AuthenticationToken added in v0.1.2

func AuthenticationToken(token string) Option

func AutoAcknowledge added in v0.1.2

func AutoAcknowledge() Option

func Credentials added in v0.1.3

func Credentials(cred credentials.TransportCredentials) Option

Jump to

Keyboard shortcuts

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