packed

package
v0.0.0-...-e5660c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test()

Types

type Packed

type Packed struct {
	Kind  reflect.Kind
	Value reflect.Value
}

func New

func New(typeInput interface{}) *Packed

New creates new packed instance, could be passed interface or reflectValue as packing schema

func (*Packed) Decode

func (p *Packed) Decode(data []byte, input interface{}) error

func (*Packed) DecodeToInterface

func (p *Packed) DecodeToInterface(data []byte) interface{}

DecodeToInterface will decode field to interface

func (*Packed) DecodeToValue

func (p *Packed) DecodeToValue(data []byte, value reflect.Value) error

func (*Packed) Encode

func (p *Packed) Encode(data interface{}) ([]byte, error)

Encode will pack passed data to byte array

func (*Packed) Minus

func (p *Packed) Minus() []byte

Minus returns -1 in byte representation of packed type

func (*Packed) Plus

func (p *Packed) Plus() []byte

Plus returns 1 in byte representation of packed type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL