v0.1.7 Latest Latest

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

Go to latest
Published: Jul 12, 2018 License: Apache-2.0 Imports: 14 Imported by: 24




This section is empty.


View Source
var (
	ErrListenerIsOff = errors.New("listener is off")


This section is empty.


type Config

type Config struct {
	// AuthManager
	AuthManager *auth.Manager

	Host string
	// Port tcp port to listen on
	Port string

Config is base configuration object used by all transports

type ConfigTCP

type ConfigTCP struct {
	Scheme string
	TLS    *tls.Config
	// contains filtered or unexported fields

ConfigTCP configuration of tcp transport

func NewConfigTCP

func NewConfigTCP(transport *Config) *ConfigTCP

NewConfigTCP allocate new transport config for tcp transport Use of this function is preferable instead of direct allocation of ConfigTCP

type ConfigWS

type ConfigWS struct {
	// CertFile
	CertFile string

	// KeyFile
	KeyFile string

	// Path
	Path string

	// SubProtocols
	SubProtocols []string
	// contains filtered or unexported fields

ConfigWS listener object for websocket server

func NewConfigWS

func NewConfigWS(transport *Config) *ConfigWS

NewConfigWS allocate new transport config for websocket transport Use of this function is preferable instead of direct allocation of ConfigWS

type Conn added in v0.0.4

type Conn interface {

Conn is wrapper to net.Conn Implemented to encapsulate bytes statistic

type Handler added in v0.0.4

type Handler interface {
	OnConnection(Conn, *auth.Manager) error

type InternalConfig

type InternalConfig struct {
	Metric systree.Metric

InternalConfig used by server implementation to configure internal specific needs

type Provider

type Provider interface {
	Protocol() string
	Serve() error
	Close() error
	Port() string
	Ready() error
	Alive() error

Provider is interface that all of transports must implement

func NewTCP

func NewTCP(config *ConfigTCP, internal *InternalConfig) (Provider, error)

NewTCP create new tcp transport

func NewWS

func NewWS(config *ConfigWS, internal *InternalConfig) (Provider, error)

NewWS create new websocket transport

Jump to

Keyboard shortcuts

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