gen

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	StructName string
	Size       []SizeArguments
	Encode     []EncodeArguments
	Decode     []DecodeArguments
}

func NewArguments

func NewArguments() *Arguments

func (*Arguments) Add

func (a *Arguments) Add(field *Field)

func (*Arguments) AddMap

func (a *Arguments) AddMap(field *Field)

func (*Arguments) AddNormal

func (a *Arguments) AddNormal(field *Field)

func (*Arguments) AddSlice

func (a *Arguments) AddSlice(field *Field)

func (*Arguments) SetStructName

func (a *Arguments) SetStructName(name string)

type BaseArguments

type BaseArguments struct {
	FieldName string
	FuncName  string
	Typ       string
	Ref       string
}

type CodecGen

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

func NewCodecGen

func NewCodecGen(pkg string) *CodecGen

func (*CodecGen) Exclude

func (g *CodecGen) Exclude(s ...string)

func (*CodecGen) Gen

func (g *CodecGen) Gen(obj interface{})

func (*CodecGen) Imports

func (g *CodecGen) Imports(s ...string)

func (*CodecGen) SaveTo

func (g *CodecGen) SaveTo(filename string)

type DecodeArguments

type DecodeArguments struct {
	BaseArguments
	SubStruct    string
	NewSubStruct string
}

func NewDecodeArguments

func NewDecodeArguments(fn []string, f *Field) DecodeArguments

type EncodeArguments

type EncodeArguments struct {
	BaseArguments
}

func NewEncodeArguments

func NewEncodeArguments(fn []string, f *Field) EncodeArguments

type Field

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

func (*Field) SetType

func (f *Field) SetType(typ FieldType)

type FieldType

type FieldType string

func (FieldType) String

func (ft FieldType) String() string

type SizeArguments

type SizeArguments struct {
	BaseArguments
}

func NewSizeArguments

func NewSizeArguments(fn string, f *Field) SizeArguments

type SubStruct

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

Jump to

Keyboard shortcuts

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