Documentation
¶
Index ¶
- Variables
- func GetName(obj any) string
- func GetNameByType(rt reflect.Type) string
- func Gunziper(outPut *bytes.Buffer, input *bytes.Buffer) error
- func Gziper(outPut *bytes.Buffer, inPut []byte) error
- func Marshal(is ...any) []byte
- func MarshalCompress(is ...any) []byte
- func MarshalCompressEncrypt(aesConfig *aesConfigStruct, is ...any) []byte
- func MarshalEncrypt(aesConfig *aesConfigStruct, is ...any) []byte
- func NewAES128config(key [16]byte) *aesConfigStruct
- func NewAES192config(key [24]byte) *aesConfigStruct
- func NewAES256config(key [32]byte) *aesConfigStruct
- func Register(i any) string
- func RegisterName(name string, rt reflect.Type)
- func Unmarshal(buf []byte, is ...any) int
- func UnmarshalCompress(buf []byte, is ...any) int
- func UnmarshalCompressEncrypt(aesConfig *aesConfigStruct, buf []byte, is ...any) int
- func UnmarshalEncrypt(aesConfig *aesConfigStruct, buf []byte, is ...any) int
- func UnusedUnixNanoEncodeTimeType()
- type Decoder
- func (d *Decoder) Decode(buf []byte, is ...any) int
- func (d *Decoder) DecodeCompress(buf []byte, is ...any) int
- func (d *Decoder) DecodeCompressEncrypt(aesConfig *aesConfigStruct, buf []byte, is ...any) int
- func (d *Decoder) DecodeEncrypt(aesConfig *aesConfigStruct, buf []byte, is ...any) int
- func (d *Decoder) DecodePtr(buf []byte, ps ...unsafe.Pointer) int
- func (d *Decoder) DecodeValue(buf []byte, vs ...reflect.Value) int
- type Encoder
- func (e *Encoder) AppendTo(buf []byte)
- func (e *Encoder) Encode(is ...any) []byte
- func (e *Encoder) EncodeCompress(is ...any) []byte
- func (e *Encoder) EncodeCompressEncrypt(aesConfig *aesConfigStruct, is ...any) []byte
- func (e *Encoder) EncodeEncrypt(aesConfig *aesConfigStruct, is ...any) []byte
- func (e *Encoder) EncodePtr(ps ...unsafe.Pointer) []byte
- func (e *Encoder) EncodeValue(vs ...reflect.Value) []byte
- type GoTinySerializer
- type GzipPool
- func (pool *GzipPool) GetReader(src io.Reader) (reader *gzip.Reader)
- func (pool *GzipPool) GetWriter(dst io.Writer) (writer *gzip.Writer)
- func (pool *GzipPool) Getbuffer() *bytes.Buffer
- func (pool *GzipPool) PutReader(reader *gzip.Reader)
- func (pool *GzipPool) PutWriter(writer *gzip.Writer)
- func (pool *GzipPool) Putbuffer(b *bytes.Buffer)
Constants ¶
This section is empty.
Variables ¶
var ( Gzip = GzipPool{ // contains filtered or unexported fields } )
Functions ¶
func GetNameByType ¶
func MarshalCompress ¶
MarshalCompress marshal and compress value
func MarshalCompressEncrypt ¶ added in v0.1.1
MarshalCompressEncrypt marshal and compress and encrypt value
func MarshalEncrypt ¶ added in v0.1.1
MarshalEncrypt marshal and encrypt value
func NewAES128config ¶ added in v0.1.1
func NewAES128config(key [16]byte) *aesConfigStruct
create AES-128 config for encryption encoding key must be 16 byte
func NewAES192config ¶ added in v0.1.1
func NewAES192config(key [24]byte) *aesConfigStruct
create AES-192 config for encryption encoding key must be 24 byte
func NewAES256config ¶ added in v0.1.1
func NewAES256config(key [32]byte) *aesConfigStruct
create AES-256 config for encryption encoding key must be 32 byte
func RegisterName ¶
func UnmarshalCompress ¶
UnmarshalCompress unmarshal compressed data
func UnmarshalCompressEncrypt ¶ added in v0.1.1
UnmarshalCompressEncrypt unmarshal compressed and encrypted data
func UnmarshalEncrypt ¶ added in v0.1.1
UnmarshalEncrypt unmarshal encrypted data
func UnusedUnixNanoEncodeTimeType ¶
func UnusedUnixNanoEncodeTimeType()
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoderWithPtr ¶
func NewDecoderWithType ¶
func (*Decoder) DecodeCompressEncrypt ¶ added in v0.1.1
DecodeCompressEncrypt decompress and decrypt and decode the data
func (*Decoder) DecodeEncrypt ¶ added in v0.1.1
DecodeEncrypt decrypt and decode the data
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoderWithPtr ¶
Create an encoder that points to the encoding of the given type.
func NewEncoderWithType ¶
func (*Encoder) EncodeCompress ¶
EncodeCompress compress and encode value The input is a pointer to the value to be encoded.
func (*Encoder) EncodeCompressEncrypt ¶ added in v0.1.1
EncodeCompressEncrypt compress and ecrypt and encode value The input is a pointer to the value to be encoded.
func (*Encoder) EncodeEncrypt ¶ added in v0.1.1
EncodeEncrypt encrypt and encode value The input is a pointer to the value to be encoded.
type GoTinySerializer ¶
type GoTinySerializer interface { // Encoding method, appends the object's serialized result to the input parameter and returns it. The method should not modify the original value of the input parameter. GotinyEncode([]byte) []byte // Decoding method, decodes the input parameter to the object and returns the length used. The method starts using the 0th byte of the input parameter and should not modify any data in the input parameter. GotinyDecode([]byte) int }
This interface should only be implemented by pointers.
type GzipPool ¶
type GzipPool struct {
// contains filtered or unexported fields
}
GzipPool manages a pool of gzip.Writer. The pool uses sync.Pool internally.
func (*GzipPool) GetReader ¶
GetReader returns gzip.Reader from the pool, or creates a new one if the pool is empty.
func (*GzipPool) GetWriter ¶
GetWriter returns gzip.Writer from the pool, or creates a new one with gzip.BestCompression if the pool is empty.
func (*GzipPool) PutReader ¶
PutReader closes and returns a gzip.Reader to the pool so that it can be reused via GetReader.