Documentation
¶
Index ¶
- Variables
- type Generator
- type GeneratorOption
- func WithDryRun(dryRun bool) GeneratorOption
- func WithInputPath(input string) GeneratorOption
- func WithLogEnabled(logs bool) GeneratorOption
- func WithLogPath(log string) GeneratorOption
- func WithLogger(logger *slog.Logger) GeneratorOption
- func WithOutputPath(output string) GeneratorOption
- func WithPrints(prints bool) GeneratorOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidOpsIntf = map[string]struct{}{
"structcopygen": {},
}
ValidOpsIntf is a set of valid conversion option keys for interface-level conversion.
View Source
var ValidOpsMethod = map[string]struct{}{
"skip_field": {},
"match_field": {},
"match_method": {},
"conv": {},
"struct_conv": {},
}
ValidOpsMethod is a set of valid conversion option keys for method-level conversion.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator instance.
func NewGenerator ¶
func NewGenerator(pkg *packages.Package, fset *token.FileSet, file *ast.File, opts ...GeneratorOption) (*Generator, error)
NewGenerator returns new Generator instance.
func (*Generator) CollectOptions ¶
func (g *Generator) CollectOptions(notations []*ast.Comment, validOps map[string]struct{}) (*structcopy.InputOption, error)
type GeneratorOption ¶
type GeneratorOption func(g *Generator)
GeneratorOption is option for Generator.
func WithInputPath ¶
func WithInputPath(input string) GeneratorOption
WithInputPath sets input path.
func WithLogEnabled ¶
func WithLogEnabled(logs bool) GeneratorOption
WithLogEnabled sets output path.
func WithOutputPath ¶
func WithOutputPath(output string) GeneratorOption
WithOutputPath sets output path.
Click to show internal directories.
Click to hide internal directories.