gen

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PkgPath    = "github.com/zusi/zusi-go"
	TcpPath    = PkgPath + "/tcp"
	GenPath    = TcpPath + "/gen"
	CommonPath = TcpPath + "/common"
	PkgErrs    = "errors"
)

Variables

This section is empty.

Functions

func FindStructsToReflect

func FindStructsToReflect(i interface{}) map[string]reflect.Type

func Generate

func Generate(msg Message, writer io.Writer) error

func GenerateReaderFile

func GenerateReaderFile(messages []Message, writer io.Writer) error

func Title

func Title(s string) string

func WriteFile

func WriteFile(messages []Message, rootPath string) error

Types

type Field

type Field struct {
	Name          string
	Id            uint16
	IdX           string
	FieldType     string
	StructType    string
	RefStructType reflect.Type
	StructPkgPath string
	Ptr           bool
	Slice         bool
	Str           bool
}

type Message

type Message struct {
	TypeName string
	PkgPath  string
	Fields   []Field
}

func Reflect

func Reflect(i interface{}) (*Message, error)

Jump to

Keyboard shortcuts

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