rpc_stream

package module
v0.0.0-...-487d906 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2015 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RpcTLS     = "RPCTLS"
	Raft       = "RAFT"
	Mesh       = "MESH"
	Registered = "REG"
)

known stream types.

Variables

View Source
var (
	ErrMissingServFunc  = errors.New("Proto struct is missing serv function")
	ErrMissingName      = errors.New("Proto needs a name")
	ErrAlreadyExists    = errors.New("Proto already exists")
	ErrBadVersions      = errors.New("Mux version unsupported")
	ErrProtoUnsupported = errors.New("Proto not supported")
	ErrNoProto          = errors.New("Add must have a proto")
)
View Source
var MuxVersionName = map[MuxVersion]string{
	UnknownVersion: "unknown",
	Mux_v1:         "Mux_v1",
	Mux_v2:         "Mux_v2",
}
View Source
var (
	SprotoSw = make(map[MuxVersion]map[string]*Sproto)
)

Functions

func Add

func Add(ver MuxVersion, proto *Sproto) error

add a new stream type to the 'proto-switch' or override default handlers.

func Lookup

func Lookup(ver MuxVersion, s string) (func(conn net.Conn) error, error)

func Nameify

func Nameify(name string) string

Types

type MuxVersion

type MuxVersion uint8
const (
	UnknownVersion MuxVersion = iota
	Mux_v1
	Mux_v2
)

func (MuxVersion) String

func (mv MuxVersion) String() string

type Sproto

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

func NewProto

func NewProto(name string, serv func(net.Conn) error) (*Sproto, error)

func (*Sproto) String

func (p *Sproto) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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