generator

package
v0.0.0-...-3a13ece Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeWriter

type CodeWriter struct{}

func (CodeWriter) Done

func (w CodeWriter) Done(travName string) string

func (CodeWriter) FieldPeersFunc

func (w CodeWriter) FieldPeersFunc(travName, prefix, castTypeName, fieldName, hashType string, names []string, isPtr bool, slice inspector.Slice, m inspector.Map) string

func (CodeWriter) FieldSelector

func (w CodeWriter) FieldSelector(travName, prefix, fieldName, parentFieldName, castTypeName string, isPtr bool, enumValue int) string

func (CodeWriter) FieldStartStruct

func (w CodeWriter) FieldStartStruct(travName, prefix, fieldName, parentFieldName, castTypeName string, isPtr bool, enumValue int) string

func (CodeWriter) FieldStructFunc

func (w CodeWriter) FieldStructFunc(travName, prefix, fieldName, nextFieldName, castTypeName, hashType string, isPtr bool, slice inspector.Slice, m inspector.Map) string

func (CodeWriter) FieldStructFuncLast

func (w CodeWriter) FieldStructFuncLast(travName, prefix, fieldName, castTypeName, hashType string, isPtr bool, slice inspector.Slice, m inspector.Map) string

func (CodeWriter) Hashers

func (w CodeWriter) Hashers(travName string) string

func (CodeWriter) Imports

func (w CodeWriter) Imports(names map[string]string) string

func (CodeWriter) InterfaceSelector

func (w CodeWriter) InterfaceSelector(prefix, castTypeName, fieldName, structPkgPrefix string, implementers map[string]string, startIdx int) string

func (CodeWriter) Package

func (w CodeWriter) Package(name string) string

func (CodeWriter) SelectorFunc

func (w CodeWriter) SelectorFunc(travName, prefix, selectorName string, fields []string) string

func (CodeWriter) Traverse

func (w CodeWriter) Traverse(travName, firstField string) string

type PathGenerator

type PathGenerator struct {
}

func NewPathGenerator

func NewPathGenerator() PathGenerator

func (PathGenerator) Generate

func (g PathGenerator) Generate(
	existingSrc string,
	m map[string]inspector.Struct,
	genName string,
	structName string,
) (string, error)

type TraverserGenerator

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

func NewTraverserGenerator

func NewTraverserGenerator(w TraverserWriter) TraverserGenerator

func (TraverserGenerator) Generate

func (g TraverserGenerator) Generate(
	m map[string]inspector.Struct,
	packageName string,
	traverserName string,
	structName string,
	isPtr bool,
	structPkgPrefix string,
	imports map[string]string,
) (string, error)

type TraverserWriter

type TraverserWriter interface {
	Package(name string) string
	Imports(names map[string]string) string
	Done(travName string) string
	Traverse(travName, name string) string
	Hashers(travName string) string

	FieldSelector(travName, prefix, fieldName, parentFieldName, castTypeName string, isPtr bool, enumValue int) string
	InterfaceSelector(prefix, castTypeName, fieldName, structPkgPrefix string, implementers map[string]string, startIdx int) string
	SelectorFunc(travName, prefix, selectorName string, fields []string) string

	FieldStartStruct(travName, prefix, fieldName, parentFieldName, castTypeName string, isPtr bool, enumValue int) string
	FieldStructFunc(travName, prefix, fieldName, nextFieldName, castTypeName, hashFn string, isPtr bool, slice inspector.Slice, m inspector.Map) string
	FieldStructFuncLast(travName, prefix, fieldName, castTypeName, hashFn string, isPtr bool, slice inspector.Slice, m inspector.Map) string
	FieldPeersFunc(travName, prefix, castTypeName, fieldName, hashFn string, names []string, isPtr bool, slice inspector.Slice, m inspector.Map) string
}

Jump to

Keyboard shortcuts

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