builder

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(err *Error) string

Types

type Basic

type Basic struct{}

func (*Basic) Build

func (*Basic) Build(_ Generator, _ *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*Basic) Matches

func (*Basic) Matches(source, target *xtype.Type) bool

type BasicTargetPointerRule

type BasicTargetPointerRule struct{}

func (*BasicTargetPointerRule) Build

func (*BasicTargetPointerRule) Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*BasicTargetPointerRule) Matches

func (*BasicTargetPointerRule) Matches(source, target *xtype.Type) bool

type Builder

type Builder interface {
	Matches(source, target *xtype.Type) bool
	Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)
}

type Error

type Error struct {
	Path  []*Path
	Cause string
}

func NewError

func NewError(cause string) *Error

func (*Error) Lift

func (e *Error) Lift(path *Path) *Error

type Generator

type Generator interface {
	Build(ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)
}

type List

type List struct{}

func (*List) Build

func (*List) Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*List) Matches

func (*List) Matches(source, target *xtype.Type) bool

type Map

type Map struct{}

func (*Map) Build

func (*Map) Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*Map) Matches

func (*Map) Matches(source, target *xtype.Type) bool

type MethodContext

type MethodContext struct {
	*namer.Namer
	Mapping       map[string]string
	IgnoredFields map[string]struct{}
	Signature     xtype.Signature
}

type Path

type Path struct {
	Prefix     string
	SourceID   string
	TargetID   string
	SourceType string
	TargetType string
}

type Pointer

type Pointer struct{}

func (*Pointer) Build

func (*Pointer) Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*Pointer) Matches

func (*Pointer) Matches(source, target *xtype.Type) bool

type Struct

type Struct struct{}

func (*Struct) Build

func (*Struct) Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*Struct) Matches

func (*Struct) Matches(source, target *xtype.Type) bool

type TargetPointer

type TargetPointer struct{}

func (*TargetPointer) Build

func (*TargetPointer) Build(gen Generator, ctx *MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *Error)

func (*TargetPointer) Matches

func (*TargetPointer) Matches(source, target *xtype.Type) bool

Jump to

Keyboard shortcuts

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