handlers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package handlers for builtin types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auto

type Auto struct {
	// contains filtered or unexported fields
}

Auto handles types that passes TypeImplementsEncoder and TypeImplementsDecoder checks.

func NewAuto

func NewAuto(typ types.Type) *Auto

NewAuto creates a handler of the given type.

func (*Auto) Decoding

func (a *Auto) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (*Auto) Encoding

func (a *Auto) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (*Auto) Len

func (a *Auto) Len() int

Len to implement TypeHandler.

func (*Auto) LenExpr

func (a *Auto) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (*Auto) Name

func (a *Auto) Name(r *renderer.Go) string

Name to implement TypeHandler.

func (*Auto) Pre

func (a *Auto) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type Bool

type Bool struct{}

Bool handlers bool type.

func (Bool) Decoding

func (Bool) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (Bool) Encoding

func (Bool) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (Bool) Len

func (Bool) Len() int

Len to implement TypeHandler.

func (Bool) LenExpr

func (Bool) LenExpr(r *renderer.Go, src string) string

LenExpr to implement handler

func (Bool) Name

func (Bool) Name(*renderer.Go) string

Name to implement TypeHandler.

func (Bool) Pre

func (Bool) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type Bytes

type Bytes struct {
	// contains filtered or unexported fields
}

Bytes handles []byte type.

func (*Bytes) Decoding

func (b *Bytes) Decoding(r *renderer.Go, dst, src string) bool

Decoding to satisfy Handler.

func (*Bytes) Encoding

func (b *Bytes) Encoding(r *renderer.Go, dst, src string)

Encoding to satisfy Handler.

func (*Bytes) Len

func (b *Bytes) Len() int

Len to satisfy Handler.

func (*Bytes) LenExpr

func (b *Bytes) LenExpr(r *renderer.Go, src string) string

LenExpr to satisfy Handler.

func (*Bytes) Name

func (b *Bytes) Name(*renderer.Go) string

Name to satisfy Handler.

func (*Bytes) Pre

func (b *Bytes) Pre(r *renderer.Go, src string)

Pre to satisfy Handler.

type BytesArray

type BytesArray int

BytesArray handles [N]byte

func (BytesArray) Decoding

func (b BytesArray) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (BytesArray) Encoding

func (b BytesArray) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (BytesArray) Len

func (b BytesArray) Len() int

Len to implement TypeHandler.

func (BytesArray) LenExpr

func (b BytesArray) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (BytesArray) Name

func (b BytesArray) Name(r *renderer.Go) string

Name to implement TypeHandler.

func (BytesArray) Pre

func (b BytesArray) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type Float

type Float int

Float handles floatX.

func Float32

func Float32() Float

Float32 handles float32.

func Float64

func Float64() Float

Float64 handles float64.

func (Float) Decoding

func (f Float) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (Float) Encoding

func (f Float) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (Float) Len

func (f Float) Len() int

Len to implement TypeHandler.

func (Float) LenExpr

func (f Float) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (Float) Name

func (f Float) Name(*renderer.Go) string

Name to implement TypeHandler.

func (Float) Pre

func (f Float) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type Int

type Int int

Int handles intXXX.

func Int16

func Int16() Int

Int16 handles int16.

func Int32

func Int32() Int

Int32 handles int32.

func Int64

func Int64() Int

Int64 handles int64.

func Int8

func Int8() Int

Int8 handles int8.

func (Int) Decoding

func (i Int) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (Int) Encoding

func (i Int) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (Int) Len

func (i Int) Len() int

Len to implement TypeHandler.

func (Int) LenExpr

func (i Int) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (Int) Name

func (i Int) Name(*renderer.Go) string

Name to implement TypeHandler.

func (Int) Pre

func (i Int) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type StringHandler

type StringHandler struct {
	// contains filtered or unexported fields
}

StringHandler handles string type.

func (*StringHandler) Decoding

func (b *StringHandler) Decoding(r *renderer.Go, dst, src string) bool

Decoding to satisfy Handler.

func (*StringHandler) Encoding

func (b *StringHandler) Encoding(r *renderer.Go, dst, src string)

Encoding to satisfy Handler.

func (*StringHandler) Len

func (b *StringHandler) Len() int

Len to satisfy Handler.

func (*StringHandler) LenExpr

func (b *StringHandler) LenExpr(r *renderer.Go, src string) string

LenExpr to satisfy Handler.

func (*StringHandler) Name

func (b *StringHandler) Name(*renderer.Go) string

Name to satisfy Handler.

func (*StringHandler) Pre

func (b *StringHandler) Pre(r *renderer.Go, src string)

Pre to satisfy Handler.

type Type

type Type interface {
	Name(r *renderer.Go) string
	Pre(r *renderer.Go, src string)
	Len() int
	LenExpr(r *renderer.Go, src string) string
	Encoding(r *renderer.Go, dst, src string)
	Decoding(r *renderer.Go, dst, src string) bool
}

Type a doubler of olrgen.TypeHandler to avoid cyclic imports.

type Uint

type Uint int

Uint handles uintXXX.

func Uint16

func Uint16() Uint

Uint16 handles uint16.

func Uint32

func Uint32() Uint

Uint32 handles uint32.

func Uint64

func Uint64() Uint

Uint64 handles uint64.

func Uint8

func Uint8() Uint

Uint8 handles uint8.

func (Uint) Decoding

func (i Uint) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (Uint) Encoding

func (i Uint) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (Uint) Len

func (i Uint) Len() int

Len to implement TypeHandler.

func (Uint) LenExpr

func (i Uint) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (Uint) Name

func (i Uint) Name(*renderer.Go) string

Name to implement TypeHandler.

func (Uint) Pre

func (i Uint) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type Uvarint

type Uvarint struct {
	// contains filtered or unexported fields
}

Uvarint handles uintXXX with uleb128 zigzag encoding/decoding.

func Uvarint16

func Uvarint16() *Uvarint

Uvarint16 handles uint16 with uleb128 zigzag encoding/decoding.

func Uvarint32

func Uvarint32() *Uvarint

Uvarint32 handles uint32 with uleb128 zigzag encoding/decoding.

func Uvarint64

func Uvarint64() *Uvarint

Uvarint64 handles uint64 with uleb128 zigzag encoding/decoding.

func (*Uvarint) Decoding

func (v *Uvarint) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (*Uvarint) Encoding

func (v *Uvarint) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (*Uvarint) Len

func (v *Uvarint) Len() int

Len to implement TypeHandler.

func (*Uvarint) LenExpr

func (v *Uvarint) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (*Uvarint) Name

func (v *Uvarint) Name(r *renderer.Go) string

Name to implement TypeHandler.

func (*Uvarint) Pre

func (v *Uvarint) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

type Varint

type Varint struct {
	// contains filtered or unexported fields
}

Varint handles intXXX with uleb128 zigzag encoding/decoding.

func Varint16

func Varint16() *Varint

Varint16 handles int16 with uleb128 zigzag encoding/decoding.

func Varint32

func Varint32() *Varint

Varint32 handles int32 with uleb128 zigzag encoding/decoding.

func Varint64

func Varint64() *Varint

Varint64 handles int64 with uleb128 zigzag encoding/decoding.

func (*Varint) Decoding

func (v *Varint) Decoding(r *renderer.Go, dst, src string) bool

Decoding to implement TypeHandler.

func (*Varint) Encoding

func (v *Varint) Encoding(r *renderer.Go, dst, src string)

Encoding to implement TypeHandler.

func (*Varint) Len

func (v *Varint) Len() int

Len to implement TypeHandler.

func (*Varint) LenExpr

func (v *Varint) LenExpr(r *renderer.Go, src string) string

LenExpr to implement TypeHandler.

func (*Varint) Name

func (v *Varint) Name(r *renderer.Go) string

Name to implement TypeHandler.

func (*Varint) Pre

func (v *Varint) Pre(r *renderer.Go, src string)

Pre to implement TypeHandler.

Jump to

Keyboard shortcuts

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