Documentation ¶
Index ¶
Constants ¶
View Source
const DELIM byte = '\n'
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Config NodeConfig Conn Connection // contains filtered or unexported fields }
func (*Client) SetConfig ¶
func (c *Client) SetConfig(nc NodeConfig)
type ConnData ¶
type ConnData struct { Conn net.Conn FrameIn chan DataFrame FrameOut chan DataFrame // contains filtered or unexported fields }
func NewConnData ¶
func (*ConnData) Deactivate ¶
func (cd *ConnData) Deactivate()
type Connection ¶
type Connection struct { ID string LinkID string Conn ConnData Input chan DataFrame Output chan DataFrame PingInterval time.Duration LastPing time.Time // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(c net.Conn) *Connection
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Ping ¶
func (c *Connection) Ping()
func (*Connection) Run ¶
func (c *Connection) Run()
func (*Connection) Send ¶
func (c *Connection) Send(kx MSGType, dx interface{})
type ConnectionLog ¶
func NewLog ¶
func NewLog() ConnectionLog
func (ConnectionLog) Add ¶
func (cl ConnectionLog) Add(df DataFrame)
type DataFrame ¶
func ParseDataFrame ¶
type DataPipe ¶
func NewDataPipe ¶
func NewDataPipe() *DataPipe
type Node ¶
type Node interface { // Port int // Active bool Link() error Run() WriteTo(string, MSGType, interface{}) Read() <-chan DataFrame // SetType(nk NodeKind) SetConfig(nc NodeConfig) Close() }
type NodeConfig ¶
func (NodeConfig) ToString ¶
func (nc NodeConfig) ToString() string
type Router ¶
type Router struct { Connections map[string]*Connection Config NodeConfig InputStream chan DataFrame LX net.Listener // contains filtered or unexported fields }
func (*Router) SetConfig ¶
func (r *Router) SetConfig(nc NodeConfig)
Click to show internal directories.
Click to hide internal directories.