puregen

package
v1.3.22 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Language          string
	Outdir            string
	Outfile           string
	CopyrightFilePath string
	CopyrightText     string // set to content of CopyrightFilePath

	ErrorWriter io.Writer // all Errors and warnings should be redirected to this io.Writer, by default it is os.Stderr

	SchemaURL       string
	SchemaTimestamp uint // for TLO version/date
	SchemaCommit    string

	// common options for many languages
	GenerateRPCCode    bool
	GenerateRandomCode bool
	BytesWhiteList     string

	Kernel pure.OptionsKernel
	Go     OptionsGo

	ProfileCPU string

	// sometimes we need to replace lots of names in vkgo repository, when we change generation.
	// so it turned out, the fastest solution is simply use generator itself
	ReplaceDir string
	// contains filtered or unexported fields
}

func (*Options) Bind

func (opt *Options) Bind(f *flag.FlagSet, languagesString string)

func (*Options) GenerateTL2 added in v1.2.35

func (opt *Options) GenerateTL2() bool

func (*Options) ReplaceStringInDir added in v1.3.4

func (opt *Options) ReplaceStringInDir() error

func (*Options) ReplaceStrings added in v1.3.4

func (opt *Options) ReplaceStrings(fileSuffix string, before string, after string)

Any generator can request replacing client code in main repository by calling this function. User should run generator with --replaceDir=XXX for each repository to replace names in.

func (*Options) Validate added in v1.2.35

func (opt *Options) Validate() error

type OptionsGo

type OptionsGo struct {
	BasicPackageNameFull   string // if empty, will be created
	TLPackageNameFull      string
	BasicRPCPath           string
	RawHandlerWhileList    string
	GenerateLegacyJsonRead bool
	UseCheckLengthSanity   bool

	SplitInternal bool
}

func (*OptionsGo) Bind

func (opt *OptionsGo) Bind(f *flag.FlagSet)

type OutDir

type OutDir struct {
	Code map[string]string // fileName->Content, split by file names relative to output dir
}

func (*OutDir) AddCodeFile

func (gen *OutDir) AddCodeFile(filepathName string, code string) error

func (*OutDir) Write

func (gen *OutDir) Write(opts *Options, markerFile string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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