musgen

package
v0.0.0-...-8db948a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const SuffixMUS = "MUS"

Variables

This section is empty.

Functions

func ArrayType

func ArrayType(t string) bool

func CurrentTypeOf

func CurrentTypeOf(s string) string

func ElemSerializer

func ElemSerializer(ad adesc.AnonymousDesc, gops genops.Options) string

func Fields

func Fields(td tdesc.TypeDesc) (fs []tdesc.FieldDesc)

func FieldsLen

func FieldsLen(td tdesc.TypeDesc) (l int)

func KeySerializer

func KeySerializer(ad adesc.AnonymousDesc, gops genops.Options) string

func MakeAddFunc

func MakeAddFunc() func(int, int) int

MakeAddFunc creates template's minus func.

func MakeArrayOps

func MakeArrayOps(ad adesc.AnonymousDesc) string

func MakeByteSliceOps

func MakeByteSliceOps(ad adesc.AnonymousDesc) string

func MakeFieldTmplPipe

func MakeFieldTmplPipe(td tdesc.TypeDesc, field tdesc.FieldDesc, index int,
	gops genops.Options) struct {
	VarName     string
	FieldsCount int
	Field       tdesc.FieldDesc
	Index       int
	Gops        genops.Options
}

func MakeFirstLetterBig

func MakeFirstLetterBig(s string) string

func MakeFirstLetterSmall

func MakeFirstLetterSmall(s string) string

func MakeIncludeFunc

func MakeIncludeFunc(tmpl *template.Template) func(string, interface{}) (string,
	error)

MakeIncludeFunc creates template's include func.

func MakeMapOps

func MakeMapOps(ad adesc.AnonymousDesc) string

func MakeMinusFunc

func MakeMinusFunc() func(int, int) int

MakeMinusFunc creates template's minus func.

func MakeSliceOps

func MakeSliceOps(ad adesc.AnonymousDesc) string

func MakeStringOps

func MakeStringOps(ad adesc.AnonymousDesc) string

func PtrType

func PtrType(t string) (ok bool)

func SerType

func SerType(td tdesc.TypeDesc) string

func SerVar

func SerVar(td tdesc.TypeDesc) string

func SerializerOf

func SerializerOf(fd tdesc.FieldDesc, gops genops.Options) string

func TmpVarName

func TmpVarName(s string) string

func VarName

func VarName(s string) string

Types

type FileGenerator

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

func NewFileGenerator

func NewFileGenerator(ops ...genops.SetOption) *FileGenerator

NewFileGenerator creates a new FileGenerator.

func (*FileGenerator) AddDTS

func (g *FileGenerator) AddDTS(t reflect.Type) (err error)

func (*FileGenerator) AddInterface

func (g *FileGenerator) AddInterface(t reflect.Type, ops ...introps.SetOption) (
	err error)

func (*FileGenerator) AddStruct

func (g *FileGenerator) AddStruct(t reflect.Type, ops ...structops.SetOption) (
	err error)

func (*FileGenerator) AddTypedef

func (g *FileGenerator) AddTypedef(t reflect.Type, ops ...typeops.SetOption) (
	err error)

func (*FileGenerator) Generate

func (g *FileGenerator) Generate() (bs []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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