puregen

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 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 Deconflicter added in v1.4.5

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

func (*Deconflicter) DeconflictName added in v1.4.5

func (d *Deconflicter) DeconflictName(s string) string

func (*Deconflicter) FillGolangIdentifies added in v1.4.5

func (d *Deconflicter) FillGolangIdentifies()

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
	PHP    OptionsPHP
	Rust   OptionsRust

	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

func (opt *Options) GenerateTL2() bool

func (*Options) ReplaceStringInDir

func (opt *Options) ReplaceStringInDir() error

func (*Options) ReplaceStrings

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

func (opt *Options) Validate() error

type OptionsGo

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

	SplitInternal bool
}

func (*OptionsGo) Bind

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

type OptionsPHP added in v1.4.9

type OptionsPHP struct {
	AddFunctionBodies            bool
	FunctionsBodiesWhiteList     string
	IgnoreUnusedInFunctionsTypes bool
	AddRPCTypes                  bool
	AddFetchers                  bool
	AddSwitcher                  bool
	AddFetchersEchoComments      bool
	InplaceSimpleStructs         bool
	UseBuiltinDataProviders      bool
	AddTypeComments              bool
	EnableInternalFunctions      bool
	EnableFieldMaskBitsConstants bool
	DisableTL1Generation         bool

	AddMetaData    bool
	AddFactoryData bool
}

func (*OptionsPHP) Bind added in v1.4.9

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

type OptionsRust added in v1.4.8

type OptionsRust struct {
	CrateName string
}

func (*OptionsRust) Bind added in v1.4.8

func (opt *OptionsRust) 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