madux_conn

package
v0.0.0-...-014678a Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetType

func GetType(h Message) int16

func RegisterNewFn

func RegisterNewFn(typ int16, fn func() Message)

func SetType

func SetType(h Message, val int16)

Types

type Buffer

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

func NewBuffer

func NewBuffer(source io.ReadWriteCloser) *Buffer

func (*Buffer) Bool

func (r *Buffer) Bool() bool

func (*Buffer) Buffered

func (r *Buffer) Buffered() int

func (*Buffer) Bytes

func (r *Buffer) Bytes() []byte

func (*Buffer) Close

func (r *Buffer) Close() error

func (*Buffer) Err

func (r *Buffer) Err() error

func (*Buffer) Flush

func (r *Buffer) Flush() error

func (*Buffer) Int16

func (r *Buffer) Int16() int16

func (*Buffer) Int32

func (r *Buffer) Int32() int32

func (*Buffer) Message

func (r *Buffer) Message(msg Message)

func (*Buffer) PutBool

func (r *Buffer) PutBool(b bool)

func (*Buffer) PutBytes

func (r *Buffer) PutBytes(b []byte)

func (*Buffer) PutInt16

func (r *Buffer) PutInt16(v int16)

func (*Buffer) PutInt32

func (r *Buffer) PutInt32(v int32)

func (*Buffer) PutMessage

func (r *Buffer) PutMessage(msg Message)

func (*Buffer) PutString

func (r *Buffer) PutString(s string)

func (*Buffer) String

func (r *Buffer) String() string

func (*Buffer) Uint16

func (r *Buffer) Uint16() uint16

type Bytes

type Bytes []byte

func NewBytes

func NewBytes(b []byte) *Bytes

func (*Bytes) Marshal

func (b *Bytes) Marshal(r *Buffer) error

func (*Bytes) Unmarshal

func (b *Bytes) Unmarshal(r *Buffer) error

type Conn

type Conn struct {
	Name string

	Width  int
	Height int
	// contains filtered or unexported fields
}

func Dial

func Dial(network, addr string) (*Conn, error)

func NewConn

func NewConn(conn net.Conn) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ReadMsg

func (c *Conn) ReadMsg() (Message, error)

func (*Conn) SendMsg

func (c *Conn) SendMsg(payload Message) error

func (*Conn) SetName

func (c *Conn) SetName(name string)

type Item

type Item struct {
	Type    int16
	Payload Message
}

type Message

type Message interface {
	Marshal(*Buffer) error
	Unmarshal(*Buffer) error
}

type String

type String string

func NewString

func NewString(str string) *String

func (*String) Marshal

func (s *String) Marshal(r *Buffer) error

func (*String) Unmarshal

func (s *String) Unmarshal(r *Buffer) error

Jump to

Keyboard shortcuts

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