fuzz

package module
v0.0.0-...-1a0441f Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BoolType   = reflect.TypeOf(bool(true))
	ByteType   = reflect.TypeOf(int8(0))
	I16Type    = reflect.TypeOf(int16(0))
	I32Type    = reflect.TypeOf(int32(0))
	I64Type    = reflect.TypeOf(int64(0))
	DoubleType = reflect.TypeOf(float64(0))
	StringType = reflect.TypeOf(string("str"))
	BinaryType = reflect.TypeOf([]byte{0})
	EnumType   = reflect.TypeOf(Enum(0))
)
View Source
var RequirednessString = [...]string{
	Default:  "default",
	Required: "required",
	Optional: "optional",
}
View Source
var TypeSize = map[thrift.TType]int{
	thrift.BOOL:   1,
	thrift.BYTE:   1,
	thrift.I16:    2,
	thrift.I32:    4,
	thrift.I64:    8,
	thrift.DOUBLE: 8,
	thrift.STRING: 4,
	thrift.LIST:   5,
	thrift.SET:    5,
	thrift.MAP:    6,
	thrift.STRUCT: 1,
}

Functions

func BuildStructField

func BuildStructField(id int16, requiredness Requiredness, ts *TypeSpec) (ret reflect.StructField)

Types

type Enum

type Enum int64

type Requiredness

type Requiredness int
const (
	Default Requiredness = iota
	Required
	Optional
)

type Type

type Type struct {
	TypeID  thrift.TType
	KeyType *Type
	ValType *Type
	Fields  map[int16]*Type
}

func Check

func Check(buf []byte, fieldTypeID thrift.TType) (typ *Type, length int, err error)

Check checks if buf is valid thrift binary-buffered binary.

func (*Type) Assignable

func (t *Type) Assignable(src *Type) bool

func (*Type) Equal

func (t *Type) Equal(src *Type) bool

type TypeConstructor

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

func (*TypeConstructor) GetType

func (t *TypeConstructor) GetType(typ *Type) (ts *TypeSpec, err error)

type TypeSpec

type TypeSpec struct {
	Type    reflect.Type
	TypeTag string
}

func BuildTypeSpec

func BuildTypeSpec(t thrift.TType, requiredness Requiredness, keySpec, valSpec *TypeSpec) *TypeSpec

type Types

type Types []*Type

func (Types) Conflict

func (ts Types) Conflict() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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