codegen

package
v0.0.0-...-9996107 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cfg *Config, logger log.Logger) error

Generate generates the code for the given config.

Types

type Config

type Config struct {
	Debug        bool
	Class        string
	ValidateOnly bool
	// contains filtered or unexported fields
}

Config is the configuration for the code generation.

func NewConfig

func NewConfig() *Config

NewConfig returns a new Config with default values.

func (*Config) AddMethodFilter

func (cfg *Config) AddMethodFilter(methodFilter string)

AddMethodFilter adds a method to the list of methodFilters to generate.

func (*Config) MethodFilter

func (cfg *Config) MethodFilter() *MethodFilter

MethodFilter creates and returns a new method filter for the current config.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the Config and returns an error if there's any problem.

type MethodFilter

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

MethodFilter is a filter for methods to be generated.

func NewMethodFilter

func NewMethodFilter(filters []string) *MethodFilter

NewMethodFilter creates a new MethodFilter.

func (*MethodFilter) Filter

func (md *MethodFilter) Filter(method string) bool

Filter returns true if the method matches one of the filters. In case no filter matches the method, the method is allowed.

Jump to

Keyboard shortcuts

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