Versions in this module Expand all Collapse all v0 v0.1.11 Oct 3, 2023 v0.1.10 Oct 2, 2023 Changes in this version + const LengthPrefixTypeAsByte + const LengthPrefixTypeAsUint16 + const LengthPrefixTypeAsUint32 + var DefaultAPI = NewAPI() + var ErrNonUTF8String = errors.New("non UTF-8 string value") + func DecodeHex(s string) ([]byte, error) + func DecodeUint256(s string) (*big.Int, error) + func DecodeUint64(s string) (uint64, error) + func EncodeHex(b []byte) string + func EncodeUint256(n *big.Int) string + func EncodeUint64(n uint64) string + type API struct + func NewAPI() *API + func (api *API) Decode(ctx context.Context, b []byte, obj interface{}, opts ...Option) (int, error) + func (api *API) Encode(ctx context.Context, obj interface{}, opts ...Option) ([]byte, error) + func (api *API) JSONDecode(ctx context.Context, data []byte, obj interface{}, opts ...Option) error + func (api *API) JSONEncode(ctx context.Context, obj any, opts ...Option) ([]byte, error) + func (api *API) MapDecode(ctx context.Context, m map[string]any, obj interface{}, opts ...Option) error + func (api *API) MapEncode(ctx context.Context, obj interface{}, opts ...Option) (*orderedmap.OrderedMap, error) + func (api *API) RegisterInterfaceObjects(iType interface{}, objs ...interface{}) error + func (api *API) RegisterTypeSettings(obj interface{}, ts TypeSettings) error + func (api *API) RegisterValidators(obj any, bytesValidatorFn func(context.Context, []byte) error, ...) error + type ArrayRules serializer.ArrayRules + type Deserializable interface + Decode func(b []byte) (int, error) + type DeserializableJSON interface + DecodeJSON func(b any) error + type LengthPrefixType serializer.SeriLengthPrefixType + type Option func(o *options) + func WithTypeSettings(ts TypeSettings) Option + func WithValidation() Option + type Serializable interface + Encode func() ([]byte, error) + type SerializableJSON interface + EncodeJSON func() (any, error) + type TypeSettings struct + func (ts TypeSettings) ArrayRules() *ArrayRules + func (ts TypeSettings) LengthPrefixType() (LengthPrefixType, bool) + func (ts TypeSettings) LexicalOrdering() (val bool, set bool) + func (ts TypeSettings) MapKey() (string, bool) + func (ts TypeSettings) MaxLen() (uint, bool) + func (ts TypeSettings) MinLen() (uint, bool) + func (ts TypeSettings) MinMaxLen() (int, int) + func (ts TypeSettings) MustMapKey() string + func (ts TypeSettings) ObjectType() interface{} + func (ts TypeSettings) WithArrayRules(rules *ArrayRules) TypeSettings + func (ts TypeSettings) WithLengthPrefixType(lpt LengthPrefixType) TypeSettings + func (ts TypeSettings) WithLexicalOrdering(val bool) TypeSettings + func (ts TypeSettings) WithMapKey(name string) TypeSettings + func (ts TypeSettings) WithMaxLen(l uint) TypeSettings + func (ts TypeSettings) WithMinLen(l uint) TypeSettings + func (ts TypeSettings) WithObjectType(t interface{}) TypeSettings