Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Binary formatterFunc Ascii formatterFunc Bcd formatterFunc )
Functions ¶
This section is empty.
Types ¶
type AsciiFormatter ¶
type AsciiFormatter struct { }
func (*AsciiFormatter) GetPackedLength ¶
func (af *AsciiFormatter) GetPackedLength(unpackedLength int) int
func (*AsciiFormatter) GetString ¶
func (af *AsciiFormatter) GetString(value []byte) string
type BcdFormatter ¶
type BcdFormatter struct { }
func (*BcdFormatter) GetPackedLength ¶
func (bf *BcdFormatter) GetPackedLength(unpackedLength int) int
func (*BcdFormatter) GetString ¶
func (bf *BcdFormatter) GetString(value []byte) string
type BinaryFormatter ¶
type BinaryFormatter struct { }
func (*BinaryFormatter) GetBytes ¶
func (bf *BinaryFormatter) GetBytes(value string) ([]byte, error)
func (*BinaryFormatter) GetPackedLength ¶
func (bf *BinaryFormatter) GetPackedLength(unpackedLength int) int
func (*BinaryFormatter) GetString ¶
func (bf *BinaryFormatter) GetString(value []byte) string
type IFormatter ¶
type IFormatter interface { GetBytes(value string) ([]byte, error) GetString([]byte) string GetPackedLength(unpackedLength int) int }
func NewAsciiFormatter ¶
func NewAsciiFormatter() IFormatter
func NewBcdFormatter ¶
func NewBcdFormatter() IFormatter
func NewBinaryFormatter ¶
func NewBinaryFormatter() IFormatter
Click to show internal directories.
Click to hide internal directories.