halcyon

package module
v0.0.0-...-cf89ddf Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: MIT Imports: 10 Imported by: 0

README

halcyon

Simple NATS-base Service RPC

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadInst = errors.New("Halcyon: not instantiated")
View Source
var ErrClientRetrySoon = errors.New("Reconnecting Soon")

Functions

This section is empty.

Types

type Client

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

func (*Client) Call

func (c *Client) Call(serviceName, reqUri string, data []byte) (interface{}, error)

func (*Client) NatsConn

func (c *Client) NatsConn() *nats.Conn

NatsConn returns internal nats connection

func (*Client) Notify

func (c *Client) Notify(serviceName string, data []byte) error

func (*Client) NotifyAll

func (c *Client) NotifyAll(data []byte) error

type ConfigFn

type ConfigFn func(*config)

func ConfigNatsConn

func ConfigNatsConn(conn *nats.Conn) ConfigFn

ConfigNatsConn set current connection

func ConfigNatsURI

func ConfigNatsURI(uri ...string) ConfigFn

ConfigNatsURI url to nats server

func ConfigNotifyTopic

func ConfigNotifyTopic(topic ...string) ConfigFn

ConfigNotifyTopic service to be notified about

func ConfigServiceName

func ConfigServiceName(name string) ConfigFn

ConfigServiceName set name of service

type Halcyon

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

func NewHalcyon

func NewHalcyon(srv Handler, opts ...ConfigFn) *Halcyon

func (*Halcyon) Run

func (h *Halcyon) Run() error

func (*Halcyon) Shutdown

func (h *Halcyon) Shutdown()

type Handler

type Handler interface {
	Init(*sr.Router, *Client) error
	Notify(context.Context, string, interface{})
}

Jump to

Keyboard shortcuts

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