conn

package
v0.0.0-...-6f4c1c9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Text   = 1
	Binary = 2
)

Variables

This section is empty.

Functions

func Broker

func Broker(brokerUri string) func(c *conf)

func IsRequester

func IsRequester(c *conf)

func IsResponder

func IsResponder(c *conf)

func Key

func Key(key *crypto.PrivateKey) func(c *conf)

func Name

func Name(name string) func(c *conf)

func NewHttpClient

func NewHttpClient(opts ...func(c *conf)) *httpClient

func Token

func Token(token string) func(c *conf)

Types

type Client

type Client interface {
	Dial() error
	Codec(*Encoder)
}

type Encoder

type Encoder struct {
	Format    string
	MsgType   int
	Marshal   func(v interface{}) ([]byte, error)
	Unmarshal func(data []byte, v interface{}) error
}
var (
	JsonCodec *Encoder
	MsgpCodec *Encoder
)

Jump to

Keyboard shortcuts

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