Documentation ¶
Overview ¶
Package gen implements code generation from TL schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileSystem ¶
FileSystem represents a directory of generated package.
type GenerateFlags ¶
type GenerateFlags struct { // Client enables client generation. Client bool // Registry enables type ID registry generation. Registry bool // Server enables experimental server generation. Server bool // Handlers enables update handler generation. Handlers bool // UpdatesClassifier enables updates classifier generation. UpdatesClassifier bool // GetSet enables getters and setters generation. GetSet bool // Mapping enables mapping helpers generation. Mapping bool // Slices enables slice helpers generation. Slices bool // TDLibJSON enables TDLib API JSON encoders and decoders generation. TDLibJSON bool }
GenerateFlags is flags for optional generation.
func (*GenerateFlags) RegisterFlags ¶
func (s *GenerateFlags) RegisterFlags(set *flag.FlagSet)
RegisterFlags registers GenerateFlags fields in given flag set.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates go types from tl.Schema.
func NewGenerator ¶
func NewGenerator(s *tl.Schema, genOpt GeneratorOptions) (*Generator, error)
NewGenerator initializes and returns new Generator from tl.Schema.
func (*Generator) WriteSource ¶
WriteSource writes generated definitions to fs.
type GeneratorOptions ¶
type GeneratorOptions struct { // DocBaseURL is a documentation base URL. // If DocBaseURL is set, Generator will embed documentation references to generated code. // // If base is https://core.telegram.org, documentation content will be also // embedded. DocBaseURL string // DocLineLimit sets GoDoc comment line length limit. DocLineLimit int GenerateFlags }
GeneratorOptions is a Generator options structure.
func (*GeneratorOptions) RegisterFlags ¶
func (s *GeneratorOptions) RegisterFlags(set *flag.FlagSet)
RegisterFlags registers GeneratorOptions fields in given flag set.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.