Documentation ¶
Index ¶
- Constants
- type AssignmentTmplInput
- type Basic
- type BasicTraverser
- type DefaultMapTmplInput
- type Generic
- type GenericCaller
- type GenericTraverser
- type Map
- type MapTraverser
- type Named
- type NamedTraverser
- type Option
- func WithBasic(b BasicTraverser) Option
- func WithBasicPointerTemplate(t map[types.BasicKind]string) Option
- func WithBasicTemplate(t map[types.BasicKind]string) Option
- func WithMap(m MapTraverser) Option
- func WithMapTemplate(t string) Option
- func WithNamed(n NamedTraverser) Option
- func WithPointer(p PointerTraverser) Option
- func WithPointerTemplate(t string) Option
- func WithSlice(s SliceTraverser) Option
- func WithSliceTemplate(t string) Option
- type Pointer
- type PointerTmplInput
- type PointerTraverser
- type Printer
- type PrinterOption
- type Slice
- type SliceTmplInput
- type SliceTraverser
- type Templater
Constants ¶
View Source
const AssignmentTmpl = `
{{ .BFieldPath }} = {{ .AFieldPath }}`
View Source
const DefaultMapTmpl = `` /* 168-byte string literal not displayed */
View Source
const DefaultPointerTmpl = `
if {{ .AFieldPath }} != nil {
{{ .BFieldPath }} = new({{ .NonPointerTypeB }})
{{ .Statements }}
}`
View Source
const DefaultSliceTmpl = `` /* 170-byte string literal not displayed */
View Source
const DirectProducerTmpl = `` /* 234-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignmentTmplInput ¶
type Basic ¶
type Basic struct { Templates map[types.BasicKind]string PointerTemplates map[types.BasicKind]string }
func (*Basic) SetPointerTemplate ¶
type BasicTraverser ¶
type DefaultMapTmplInput ¶
type Generic ¶
type Generic struct { Imports *packages.Imports Named NamedTraverser Slice SliceTraverser Basic BasicTraverser Map MapTraverser Pointer PointerTraverser }
type GenericCaller ¶
type GenericCaller interface {
SetGenericTraverser(p GenericTraverser)
}
type GenericTraverser ¶
type Map ¶
type Map struct { Template string Imports *packages.Imports Generic GenericTraverser }
func (*Map) SetGenericTraverser ¶
func (m *Map) SetGenericTraverser(p GenericTraverser)
func (*Map) SetTemplate ¶
type MapTraverser ¶
type Named ¶
type Named struct {
Generic GenericTraverser
}
func (*Named) SetGenericTraverser ¶
func (s *Named) SetGenericTraverser(p GenericTraverser)
type NamedTraverser ¶
type Option ¶
type Option func(*Generic)
func WithBasic ¶
func WithBasic(b BasicTraverser) Option
func WithMap ¶
func WithMap(m MapTraverser) Option
func WithMapTemplate ¶
func WithNamed ¶
func WithNamed(n NamedTraverser) Option
func WithPointer ¶
func WithPointer(p PointerTraverser) Option
func WithPointerTemplate ¶
func WithSlice ¶
func WithSlice(s SliceTraverser) Option
func WithSliceTemplate ¶
type Pointer ¶
type Pointer struct { Template string Imports *packages.Imports Generic GenericTraverser }
func NewPointer ¶
func (*Pointer) SetGenericTraverser ¶
func (p *Pointer) SetGenericTraverser(tt GenericTraverser)
func (*Pointer) SetTemplate ¶
type PointerTmplInput ¶
type PointerTraverser ¶
type Printer ¶
type Printer struct { Imports *packages.Imports Traverser GenericTraverser Template string }
func NewPrinter ¶
func NewPrinter(im *packages.Imports, tr GenericTraverser, opts ...PrinterOption) *Printer
type PrinterOption ¶
type PrinterOption func(p *Printer)
func WithTemplate ¶
func WithTemplate(t string) PrinterOption
type Slice ¶
type Slice struct { Template string Imports *packages.Imports Generic GenericTraverser }
func (*Slice) SetGenericTraverser ¶
func (s *Slice) SetGenericTraverser(p GenericTraverser)
func (*Slice) SetTemplate ¶
type SliceTmplInput ¶
type SliceTraverser ¶
Click to show internal directories.
Click to hide internal directories.