msg

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2015 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Included []int
	Excluded []int
}

func NewFilter

func NewFilter() *Filter

func (*Filter) GetIn

func (f *Filter) GetIn() []int

func (*Filter) GetOut

func (f *Filter) GetOut() []int

func (*Filter) In

func (f *Filter) In(id int)

func (*Filter) Out

func (f *Filter) Out(id int)

func (*Filter) String

func (f *Filter) String() string

type Format

type Format int
const (
	FORMAT_NULL Format = 1 << iota
	FORMAT_ID
	FORMAT_TIMESTAMP
	FORMAT_DATA
	FORMAT_NEWLINE
	FORMAT_META = FORMAT_ID | FORMAT_TIMESTAMP | FORMAT_DATA
)

type Message

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

func Cast

func Cast(i interface{}) Message

func Msg

func Msg(senderID int, data []byte) Message

func Parse

func Parse(msg []byte) (Message, error)

func (*Message) Allowed

func (m *Message) Allowed(f *Filter) bool

func (Message) Data

func (m Message) Data() []byte

func (Message) Format

func (m Message) Format(f Format) string

func (Message) String

func (m Message) String() string

func (Message) WriteFormat

func (m Message) WriteFormat(w io.Writer, f Format) (int, error)

XXX: We implement only the combinations we actually use.

Jump to

Keyboard shortcuts

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