generator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatByGoFmt

func FormatByGoFmt(b *bytes.Buffer) (*bytes.Buffer, error)

func FormatByGoFmtInto

func FormatByGoFmtInto(b *bytes.Buffer) error

func GenerateAll

func GenerateAll(config *Config, generators []Generator) error

func GenerateUsingRegistered

func GenerateUsingRegistered(config *Config) error

func RegisterGenerator

func RegisterGenerator(gen Generator)

func SaveFileAsGo

func SaveFileAsGo(evenIfError bool, directory string, filename string, buffer *bytes.Buffer) error

Types

type Config

type Config struct {
	// Do wew. użytku dla generatorów aby mogły się ze sobą komunikować
	Values map[string]interface{}
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(packageName, outputdir string, parsedSources *model.ParsedSources) *Config

func NewConfigUsingRegistry

func NewConfigUsingRegistry(packageName, outputdir string, parsedSources *model.ParsedSources, register annotations.AnnotationRegister) *Config

func (*Config) AddImport

func (f *Config) AddImport(name ...string)

func (*Config) AddMassValue

func (c *Config) AddMassValue(value interface{}, keys []string)

AddStrValue("true", []string{"klucz1","klucz2","klucz3"...})

func (*Config) AddValue

func (c *Config) AddValue(key string, value interface{})

func (*Config) Enums

func (f *Config) Enums() []model.Enum

func (*Config) FileNames

func (f *Config) FileNames() []string

func (*Config) Get

func (f *Config) Get(name string) *bytes.Buffer

func (Config) GetImports

func (f Config) GetImports() []string

func (*Config) Interfaces

func (f *Config) Interfaces() []model.Interface

func (Config) IsSetValue

func (c Config) IsSetValue(name string) bool

func (*Config) Operations

func (f *Config) Operations() []model.Operation

aby skrócić kod

func (*Config) OutputDir

func (f *Config) OutputDir() string

func (*Config) PackageName

func (f *Config) PackageName() string

func (*Config) ParsedSources

func (f *Config) ParsedSources() *model.ParsedSources

func (*Config) Registry

func (f *Config) Registry() annotations.AnnotationRegister

func (*Config) Save

func (f *Config) Save(evenIfError bool, filenames ...string) error

func (*Config) SaveAll

func (f *Config) SaveAll(evenIfError bool) error

func (*Config) Structs

func (f *Config) Structs() []model.Struct

func (*Config) Typedefs

func (f *Config) Typedefs() []model.Typedef

type Generator

type Generator interface {
	Name() string
	GetAnnotations() []annotations.AnnotationDescriptor
	Generate(config *Config) error
}

Jump to

Keyboard shortcuts

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