Documentation ¶
Index ¶
- Constants
- type BinaryReader
- func (self *BinaryReader) Offset() int64
- func (self *BinaryReader) ReadBytes(size int) ([]byte, error)
- func (self *BinaryReader) ReadINT16() (int16, error)
- func (self *BinaryReader) ReadINT32() (int32, error)
- func (self *BinaryReader) ReadUINT16() (uint16, error)
- func (self *BinaryReader) ReadUINT32() (uint32, error)
- func (self *BinaryReader) ReadUINT8() (uint8, error)
- func (self *BinaryReader) ReadUntil(ch byte) ([]byte, error)
- func (self *BinaryReader) ReadZString() ([]byte, error)
- type BinaryWriter
- func (self *BinaryWriter) Close()
- func (self *BinaryWriter) Offset() int64
- func (self *BinaryWriter) WriteBytes(msg []byte) error
- func (self *BinaryWriter) WriteINT32(value int32) error
- func (self *BinaryWriter) WriteUINT16(value uint16) error
- func (self *BinaryWriter) WriteUINT32(value uint32) error
- func (self *BinaryWriter) WriteUINT8(value uint8) error
- func (self *BinaryWriter) WriteZString(msg []byte) error
- func (self *BinaryWriter) WriteZStringWithLimit(msg []byte, maxSize int) error
- type Kludge
- type KludgeState
- type Message
- type MessageBody
- func (self *MessageBody) AddAttach(attach MessageBodyAttach)
- func (self *MessageBody) AddKludge(k Kludge)
- func (self *MessageBody) AddLine(line []byte)
- func (self MessageBody) Bytes() []byte
- func (self MessageBody) GetArea() string
- func (self MessageBody) GetAttachments() []MessageBodyAttach
- func (self MessageBody) GetContent() []byte
- func (self *MessageBody) GetKludges() []Kludge
- func (self MessageBody) GetOrigin() []byte
- func (self MessageBody) GetPacket() []byte
- func (self MessageBody) IsArea() bool
- func (self *MessageBody) SetArea(area string)
- func (self *MessageBody) SetContent(content []byte)
- func (self *MessageBody) SetOrigin(origin []byte)
- func (self *MessageBody) SetPacket(packet []byte)
- type MessageBodyAttach
- func (self *MessageBodyAttach) GetData() []byte
- func (self *MessageBodyAttach) GetName() string
- func (self *MessageBodyAttach) Len() int
- func (self *MessageBodyAttach) Read() ([]byte, error)
- func (self *MessageBodyAttach) SetData(data []byte)
- func (self *MessageBodyAttach) SetName(name string)
- func (self *MessageBodyAttach) SetPermission(permission string)
- func (self *MessageBodyAttach) Write(row []byte) error
- type MessageBodyParser
- type MsgAttr
- type NetAddr
- type PackedMessage
- func (self *PackedMessage) SetAttribute(attr MsgAttr)
- func (self *PackedMessage) SetFromUserName(FromUserName []byte) error
- func (self *PackedMessage) SetSubject(s []byte) error
- func (self *PackedMessage) SetText(Text []byte)
- func (self *PackedMessage) SetTime(t *fidotime.FidoDate) error
- func (self *PackedMessage) SetToUserName(ToUserName []byte) error
- type PacketHeader
- type PacketReader
- type PacketWriter
Constants ¶
View Source
const ( MSG_BODY_PARSE_BODY = 1 MSG_BODY_PARSE_UUE = 2 MSG_BODY_PARSE_ROUTE_INFO = 3 )
View Source
const ( SOH = "\x01" CR = "\x0D" )
View Source
const (
AREA_KLUDGE = "AREA:"
)
View Source
const (
// CR = "\x0D"
LF = "\x0A"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryReader ¶
type BinaryReader struct {
// contains filtered or unexported fields
}
func NewBinaryReader ¶
func NewBinaryReader(reader io.Reader) *BinaryReader
func (*BinaryReader) Offset ¶
func (self *BinaryReader) Offset() int64
func (*BinaryReader) ReadINT16 ¶
func (self *BinaryReader) ReadINT16() (int16, error)
func (*BinaryReader) ReadINT32 ¶
func (self *BinaryReader) ReadINT32() (int32, error)
func (*BinaryReader) ReadUINT16 ¶
func (self *BinaryReader) ReadUINT16() (uint16, error)
func (*BinaryReader) ReadUINT32 ¶
func (self *BinaryReader) ReadUINT32() (uint32, error)
func (*BinaryReader) ReadUINT8 ¶
func (self *BinaryReader) ReadUINT8() (uint8, error)
func (*BinaryReader) ReadZString ¶
func (self *BinaryReader) ReadZString() ([]byte, error)
type BinaryWriter ¶
type BinaryWriter struct {
// contains filtered or unexported fields
}
func NewBinaryWriter ¶
func NewBinaryWriter(writer io.Writer) (*BinaryWriter, error)
func (*BinaryWriter) Close ¶
func (self *BinaryWriter) Close()
func (*BinaryWriter) Offset ¶
func (self *BinaryWriter) Offset() int64
func (*BinaryWriter) WriteBytes ¶
func (self *BinaryWriter) WriteBytes(msg []byte) error
func (*BinaryWriter) WriteINT32 ¶
func (self *BinaryWriter) WriteINT32(value int32) error
func (*BinaryWriter) WriteUINT16 ¶
func (self *BinaryWriter) WriteUINT16(value uint16) error
func (*BinaryWriter) WriteUINT32 ¶
func (self *BinaryWriter) WriteUINT32(value uint32) error
func (*BinaryWriter) WriteUINT8 ¶
func (self *BinaryWriter) WriteUINT8(value uint8) error
func (*BinaryWriter) WriteZString ¶
func (self *BinaryWriter) WriteZString(msg []byte) error
func (*BinaryWriter) WriteZStringWithLimit ¶
func (self *BinaryWriter) WriteZStringWithLimit(msg []byte, maxSize int) error
type KludgeState ¶
type KludgeState int8
const ( KludgeStateName KludgeState = 1 KludgeStateValue KludgeState = 2 )
type Message ¶
type Message struct { Area string From string FromAddr string To string ToAddr string Subject string Content string UnixTime int64 /* Unit time stampe */ Time *time.Time }
func NewMessage ¶
func NewMessage() *Message
type MessageBody ¶
type MessageBody struct {
// contains filtered or unexported fields
}
func NewMessageBody ¶
func NewMessageBody() *MessageBody
func (*MessageBody) AddAttach ¶
func (self *MessageBody) AddAttach(attach MessageBodyAttach)
func (*MessageBody) AddKludge ¶
func (self *MessageBody) AddKludge(k Kludge)
func (*MessageBody) AddLine ¶
func (self *MessageBody) AddLine(line []byte)
func (MessageBody) Bytes ¶
func (self MessageBody) Bytes() []byte
func (MessageBody) GetArea ¶
func (self MessageBody) GetArea() string
func (MessageBody) GetAttachments ¶
func (self MessageBody) GetAttachments() []MessageBodyAttach
func (MessageBody) GetContent ¶
func (self MessageBody) GetContent() []byte
func (*MessageBody) GetKludges ¶
func (self *MessageBody) GetKludges() []Kludge
func (MessageBody) GetOrigin ¶
func (self MessageBody) GetOrigin() []byte
func (MessageBody) GetPacket ¶
func (self MessageBody) GetPacket() []byte
func (MessageBody) IsArea ¶
func (self MessageBody) IsArea() bool
func (*MessageBody) SetArea ¶
func (self *MessageBody) SetArea(area string)
func (*MessageBody) SetContent ¶
func (self *MessageBody) SetContent(content []byte)
func (*MessageBody) SetOrigin ¶
func (self *MessageBody) SetOrigin(origin []byte)
func (*MessageBody) SetPacket ¶
func (self *MessageBody) SetPacket(packet []byte)
type MessageBodyAttach ¶
type MessageBodyAttach struct {
// contains filtered or unexported fields
}
func NewMessageBodyAttach ¶
func NewMessageBodyAttach() *MessageBodyAttach
func (*MessageBodyAttach) GetData ¶
func (self *MessageBodyAttach) GetData() []byte
func (*MessageBodyAttach) GetName ¶
func (self *MessageBodyAttach) GetName() string
func (*MessageBodyAttach) Len ¶
func (self *MessageBodyAttach) Len() int
func (*MessageBodyAttach) Read ¶
func (self *MessageBodyAttach) Read() ([]byte, error)
func (*MessageBodyAttach) SetData ¶
func (self *MessageBodyAttach) SetData(data []byte)
func (*MessageBodyAttach) SetName ¶
func (self *MessageBodyAttach) SetName(name string)
func (*MessageBodyAttach) SetPermission ¶
func (self *MessageBodyAttach) SetPermission(permission string)
func (*MessageBodyAttach) Write ¶
func (self *MessageBodyAttach) Write(row []byte) error
type MessageBodyParser ¶
type MessageBodyParser struct {
// contains filtered or unexported fields
}
func NewMessageBodyParser ¶
func NewMessageBodyParser() *MessageBodyParser
func (MessageBodyParser) Parse ¶
func (self MessageBodyParser) Parse(content []byte) (*MessageBody, error)
func (*MessageBodyParser) SetDecodeAttachment ¶
func (self *MessageBodyParser) SetDecodeAttachment(yesno bool)
type NetAddr ¶
func NewNetAddr ¶
func NewNetAddr() *NetAddr
type PackedMessage ¶
type PackedMessage struct { OrigAddr NetAddr DestAddr NetAddr Attributes uint16 Time *fidotime.FidoDate ToUserName []byte FromUserName []byte Subject []byte Text []byte }
func NewPackedMessage ¶
func NewPackedMessage() *PackedMessage
func (*PackedMessage) SetAttribute ¶
func (self *PackedMessage) SetAttribute(attr MsgAttr)
func (*PackedMessage) SetFromUserName ¶
func (self *PackedMessage) SetFromUserName(FromUserName []byte) error
func (*PackedMessage) SetSubject ¶
func (self *PackedMessage) SetSubject(s []byte) error
func (*PackedMessage) SetText ¶
func (self *PackedMessage) SetText(Text []byte)
func (*PackedMessage) SetToUserName ¶
func (self *PackedMessage) SetToUserName(ToUserName []byte) error
type PacketHeader ¶
type PacketHeader struct { /* Origination */ OrigZone uint16 OrigNet uint16 OrigNode uint16 OrigPoint uint16 /* Destination */ DestZone uint16 DestNet uint16 DestNode uint16 DestPoint uint16 /* Date and time */ Year uint16 Month uint16 Day uint16 Hour uint16 Minute uint16 Second uint16 /* Password */ PktPassword []byte }
func NewPacketHeader ¶
func NewPacketHeader() *PacketHeader
func (PacketHeader) GetDate ¶
func (self PacketHeader) GetDate() time.Time
func (*PacketHeader) SetDate ¶
func (self *PacketHeader) SetDate(newDate time.Time)
func (*PacketHeader) SetDestAddr ¶
func (self *PacketHeader) SetDestAddr(addr string)
func (*PacketHeader) SetOrigAddr ¶
func (self *PacketHeader) SetOrigAddr(addr string)
func (*PacketHeader) SetPassword ¶
func (self *PacketHeader) SetPassword(password string)
type PacketReader ¶
type PacketReader struct {
// contains filtered or unexported fields
}
func NewPacketReader ¶
func NewPacketReader(stream io.Reader) *PacketReader
func (*PacketReader) ReadPackedMessage ¶
func (self *PacketReader) ReadPackedMessage() (*PackedMessage, error)
func (*PacketReader) ReadPacketHeader ¶
func (self *PacketReader) ReadPacketHeader() (*PacketHeader, error)
type PacketWriter ¶
type PacketWriter struct {
// contains filtered or unexported fields
}
func NewPacketWriter ¶
func NewPacketWriter(stream io.Writer) (*PacketWriter, error)
func (*PacketWriter) WritePackedMessage ¶
func (self *PacketWriter) WritePackedMessage(packedMessage *PackedMessage) error
func (*PacketWriter) WritePacketEnd ¶
func (self *PacketWriter) WritePacketEnd() error
func (*PacketWriter) WritePacketHeader ¶
func (self *PacketWriter) WritePacketHeader(pktHeader *PacketHeader) error
Click to show internal directories.
Click to hide internal directories.