client

package
v0.0.0-...-f0dc348 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServiceStub

func NewServiceStub(c *Client, name string, identification string) *serviceStub

Types

type Client

type Client struct {

	// The cellaserv service stub
	Cs *serviceStub
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ClientOpts) *Client

NewConnection returns a Client instance connected to cellaserv or panics

func (*Client) ClientId

func (c *Client) ClientId() string

clientId returns the broker identifier for this client

func (*Client) Close

func (c *Client) Close()

Close shuts down the client.

func (*Client) Log

func (c *Client) Log(what string, data interface{})

Log sends a log message to cellaserv

func (*Client) NewService

func (c *Client) NewService(name string, identification string) *service

NewService returns an initialized Service instance

func (*Client) Publish

func (c *Client) Publish(event string, data interface{})

func (*Client) PublishRaw

func (c *Client) PublishRaw(event string, data []byte)

func (*Client) Quit

func (c *Client) Quit() <-chan struct{}

Quit returns the receive-only quit channel.

func (*Client) RegisterService

func (c *Client) RegisterService(s *service)

func (*Client) Spy

func (c *Client) Spy(serviceName string, serviceIdentification string, handler spyHandler) error

func (*Client) Subscribe

func (c *Client) Subscribe(eventPattern string, handler subscriberHandler) error

func (*Client) SubscribeUntil

func (c *Client) SubscribeUntil(eventPattern string, handler subscriberUntilHandler) error

type ClientOpts

type ClientOpts struct {
	// Address of the cellaserv server
	CellaservAddr string
	// Name sent to cellaserv to describe the client
	Name string
	// Address where the internal web service will listen, empty to disable web server
	WebListenAddress string
}

type EventHandlerFunc

type EventHandlerFunc func(*cellaserv.Publish)

type RequestHandlerFunc

type RequestHandlerFunc func(*cellaserv.Request) (interface{}, error)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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