Documentation
¶
Index ¶
- Variables
- func Base16Decoding(data []byte) ([]byte, error)
- func Base16Encoding(data []byte) []byte
- func Base32Decoding(data []byte) ([]byte, error)
- func Base32Encoding(data []byte) []byte
- func Base64Decoding(data []byte) ([]byte, error)
- func Base64Encoding(data []byte) []byte
- func WriteConn(conn net.Conn, msg *Message, aes_key *[32]byte) error
- type Config
- type Message
- func (m *Message) AddContent(content any) error
- func (m *Message) AddFile(file MessageFile) error
- func (m *Message) AddHeader(key string, value string) error
- func (m *Message) AddRawFile(name string, data []byte) error
- func (m *Message) BodyDelimiter() []byte
- func (m *Message) ContentLength() int
- func (m *Message) EndingDelimiter() []byte
- func (m *Message) FileDelimiter() []byte
- func (m *Message) Generate() (*Message, error)
- func (m *Message) HeaderDelimiter() []byte
- func (m *Message) Parse() (*Message, error)
- type MessageFile
Constants ¶
This section is empty.
Variables ¶
View Source
var BANNED_DELIMITERS = []string{
"=", "_", "\x08",
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
}
View Source
var STANDARD_DELIM []byte = []byte("$")
Functions ¶
func Base32Decoding ¶ added in v1.3.5
Base32 decoding
func Base64Decoding ¶ added in v1.2.5
Base64 decoding
Types ¶
type Config ¶ added in v1.1.6
type Config struct {
Delimiter []byte
UseEncoding bool
UseCrypto bool
BufSize int
Encode_func func([]byte) []byte
Decode_func func([]byte) ([]byte, error)
PrivateKey *rsa.PrivateKey
PublicKey *rsa.PublicKey
}
func NewConfig ¶ added in v1.2.1
func NewConfig(delimiter []byte, useencoding bool, usecrypto bool, bufsize int, encode_f func([]byte) []byte, decode_f func([]byte) ([]byte, error)) *Config
NewConfig creates a new Config.
func (*Config) NewMessage ¶ added in v1.2.5
type Message ¶
type Message struct {
Data []byte
Delimiter []byte
Headers map[string][]string
Body []byte
Files map[string]MessageFile
UseEncoding bool
Encode_func func([]byte) []byte
Decode_func func([]byte) ([]byte, error)
}
A Message is a protocol message.
func NewMessage ¶
func NewMessage(delimiter []byte, useencoding bool, encode_func func([]byte) []byte, decode_func func([]byte) ([]byte, error)) *Message
NewMessage creates a new Message.
func (*Message) AddContent ¶ added in v1.1.7
func (*Message) AddFile ¶ added in v1.1.7
func (m *Message) AddFile(file MessageFile) error
func (*Message) AddRawFile ¶ added in v1.1.7
func (*Message) BodyDelimiter ¶ added in v1.1.4
func (*Message) ContentLength ¶
Get content length of the message.
func (*Message) EndingDelimiter ¶ added in v1.1.4
func (*Message) FileDelimiter ¶ added in v1.1.7
func (*Message) Generate ¶
creates a protocol message. Header is a map of key/value pairs. Body is a base64 encoded byte slice.
func (*Message) HeaderDelimiter ¶ added in v1.1.4
type MessageFile ¶ added in v1.1.7
Click to show internal directories.
Click to hide internal directories.