config

package
v0.0.0-...-ca4481b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = ConverterConfig{
	OutputFile:        "./generated/generated.go",
	OutputPackageName: "generated",
}

Functions

This section is empty.

Types

type Common

type Common struct {
	FieldSettings                      []string
	WrapErrors                         bool
	IgnoreUnexported                   bool
	MatchIgnoreCase                    bool
	IgnoreMissing                      bool
	SkipCopySameType                   bool
	UseZeroValueOnPointerInconsistency bool
	UseUnderlyingTypeMethods           bool
}

type Converter

type Converter struct {
	ConverterConfig
	Package    string
	FileSource string
	Type       types.Type
	Methods    map[string]*Method
}

func Parse

func Parse(raw *Raw) ([]*Converter, error)

type ConverterConfig

type ConverterConfig struct {
	Common
	Name              string
	OutputFile        string
	OutputPackagePath string
	OutputPackageName string
	Extend            []*method.Definition
	Comments          []string
}

func (*ConverterConfig) PackageID

func (conf *ConverterConfig) PackageID() string

type FieldMapping

type FieldMapping struct {
	Source   string
	Function *method.Definition
	Ignore   bool
}

type Method

type Method struct {
	*method.Definition
	Common

	Constructor *method.Definition
	AutoMap     []string
	Fields      map[string]*FieldMapping

	RawFieldSettings []string
}

func (*Method) Field

func (m *Method) Field(targetName string) *FieldMapping

type Raw

type Raw struct {
	Converters []RawConverter
	Global     RawLines

	WorkDir              string
	BuildTags            string
	OuputBuildConstraint string
}

type RawConverter

type RawConverter struct {
	Package       string
	InterfaceName string
	Converter     RawLines
	Methods       map[string]RawLines
	FileSource    string
}

type RawLines

type RawLines struct {
	Location string
	Lines    []string
}

Jump to

Keyboard shortcuts

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