Documentation
¶
Index ¶
- Constants
- Variables
- func CP866toUTF8(src []byte) []byte
- func ComposeAddress(fAddr FidoNetAddress) (strAddr string)
- func GetKludges(msgText string) map[string]string
- func GetMsgBody(msgText string) (text string)
- func GetOutboundDir(fAddr FidoNetAddress) string
- func PktRead(pktFileName string) (pktHead PktHeader, pktPassword string, messages []FidoMessage, err error)
- func PktWrite(pktFileName string, pktHead PktHeader, messages []FidoMessage) error
- func UTF8toCP866(src []byte) []byte
- type FidoMessage
- type FidoNetAddress
- type PktHeader
Constants ¶
const ( // PktUserNameSize maximum size of null terminated User Name variable PktUserNameSize = 36 // PktSubjectSize maximum size of null terminated Subject variable PktSubjectSize = 72 // PktTextSize maximum size of null terminated Text variable (Body of the message) PktTextSize = 65535 // PktDateTimeLayout parsing time layout PktDateTimeLayout = "02 Jan 06 15:04:05" )
Variables ¶
var ReFidoNetAddress = regexp.MustCompile(`^(\d{1,4}):(\d{1,5})/(\d{1,5})[.]?(\d{1,5})?[@]?([a-z]*)$`)
ReFidoNetAddress regular expression matches standard FidoNet address string
Functions ¶
func CP866toUTF8 ¶
CP866toUTF8 converts slice of bytes from CP866 codepage to UTF8
func ComposeAddress ¶
func ComposeAddress(fAddr FidoNetAddress) (strAddr string)
ComposeAddress makes FidoNet address string from FidoNetAddress struct
func GetKludges ¶
GetKludges returns a map of kludges (without colons) from message text (body)
func GetMsgBody ¶
GetMsgBody returns message body without kludges
func GetOutboundDir ¶
func GetOutboundDir(fAddr FidoNetAddress) string
GetOutboundDir returns outbound directory name for Points of the Node
func PktRead ¶
func PktRead(pktFileName string) (pktHead PktHeader, pktPassword string, messages []FidoMessage, err error)
PktRead returns slice of Messages from .pkt file
func PktWrite ¶
func PktWrite(pktFileName string, pktHead PktHeader, messages []FidoMessage) error
By now it's UNTESTED!!! PktWrite creates and write .pkt file
func UTF8toCP866 ¶
UTF8toCP866 converts slice of bytes from UTF8 to CP866 codepage (changing russian "Н" char to similar latin "H")
Types ¶
type FidoMessage ¶
type FidoMessage struct { FromName string FromAddr FidoNetAddress ToName string ToAddr FidoNetAddress Subj string Text string DateTime time.Time Attributes uint16 }
FidoMessage implements simple Message architecture
type FidoNetAddress ¶
FidoNetAddress structure of FidoNet address zone:network/node.point@domain
func ParseAddress ¶
func ParseAddress(strAddr string) (fAddress FidoNetAddress, err error)
ParseAddress parses a string with FidoNet address and returns it's separate elements
type PktHeader ¶
type PktHeader struct { OrigNode uint16 // of packet, not of messages in packet DestNode uint16 // of packet, not of messages in packet Year uint16 // of packet creation, e.g. 1986 Month uint16 // of packet creation, 0-11 for Jan-Dec Day uint16 // of packet creation, 1-31 Hour uint16 // of packet creation, 0-23 Minute uint16 // of packet creation, 0-59 Second uint16 // of packet creation, 0-59 Baud uint16 // max baud rate of orig and dest, 0=SEA PacketType uint16 // old type-1 packets now obsolete OrigNet uint16 // of packet, not of messages in packet DestNet uint16 // of packet, not of messages in packet ProdCode byte // 0 for Fido, write to FTSC for others SerialNo byte // binary serial number (otherwise null) Password [8]byte // session password (otherwise null) OrigZone uint16 // zone of pkt sender (otherwise null) DestZone uint16 // zone of pkt receiver (otherwise null) Filled [20]byte }
PktHeader header of standard .pkt file