internal

package
v0.0.0-...-dcc94ce Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValueTypeValue = ValueType(iota + 1)
	ValueTypeFunc
)

Variables

This section is empty.

Functions

func Env

func Env() (dir, file string, line int, err error)

func FirstLower

func FirstLower(s string) string

func GetTemplate

func GetTemplate(in interface{}) string

func Template

func Template(dir, filename string, line int) error

func TemplateInfoLine

func TemplateInfoLine(dir, filename string, structName string) (int, string, error)

func Templater

func Templater(dir, file string, line int, options ...Option) error

Types

type Config

type Config struct {
	Tags          string
	TemplateTags  string
	ForceDelete   bool
	Verbose       bool
	Override      bool
	CommentPrefix string
}

func NewConfig

func NewConfig() Config

type InfoContext

type InfoContext struct {
	Tags             string
	CommentPrefix    string
	TemplateTags     string
	Fs               *token.FileSet
	AstFile          *ast.File
	Line             int
	Success          bool
	WorkingDirectory string

	Filename string
	File     string

	TemplatePkg      string
	TemplatePath     string
	TemplateStruct   string
	TemplateFilename string
	TemplateLine     int

	TemplateRandName string

	DataPkg           string
	ProjectPkg        string
	PackagePath       string
	ProjectPath       string
	Package           string
	IdentName         string
	ValueType         ValueType
	IsPtr             bool
	GeneratedFilename string
	ValueGetter       string
}

func Info

func Info(dir, filename string, line int, options ...Option) (InfoContext, error)

func (InfoContext) PtrStar

func (i InfoContext) PtrStar() string

type Option

type Option func(Config) Config

func WithConfig

func WithConfig(config Config) Option

type TemplateContext

type TemplateContext struct {
	Fs                 *token.FileSet
	AstFile            *ast.File
	Success            bool
	WorkingDirectory   string
	Filename           string
	TemplateFilename   string
	TemplateGoFilename string
	File               string
	Package            string
	StructName         string
}

func TemplateInfo

func TemplateInfo(dir, filename string, line int) (TemplateContext, error)

type ValueType

type ValueType int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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