network

package
v0.0.0-...-9c04300 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldName    = "name"
	FieldAddr    = "addr"
	FieldSession = "session"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptor

type Acceptor interface {
	Service
	Count() int64
	State() State
	Broadcast(interface{})
	BroadcastRaw([]byte)
}

type ConnectFailed

type ConnectFailed struct {
}

type Connected

type Connected struct {
}

type Connector

type Connector interface {
	Service
	Connected() bool
	Send(interface{}) error
	SendRaw([]byte) error
}

type Disconnected

type Disconnected struct {
}

type Event

type Event struct {
	Meta message.Meta
	Msg  interface{}
	Ses  session.Session
}

func NewConnectFailedEvent

func NewConnectFailedEvent() *Event

func NewConnectedEvent

func NewConnectedEvent(ses session.Session) *Event

func NewDisconnectedEvent

func NewDisconnectedEvent(ses session.Session) *Event

type HandlerFunc

type HandlerFunc func(*Event)

type Service

type Service interface {
	Run()
	Stop()
}

type State

type State string
const (
	Stopped State = "stopped"
	Running State = "running"
	Closing State = "closing"
)

Jump to

Keyboard shortcuts

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