mappers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnotherStruct

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

type BaseStructuresMapper

type BaseStructuresMapper interface {
	Structures1(in *input.StructuresMapping) output.StructuresMapping

	// Structures2
	// @Mapping(target="AnotherField1", source="in.Field1.Field1.Field2")
	// @Mapping(target="AnotherField2", source="in.Field2.Field1.Field1")
	// @Mapping(target="AnotherField3", source="in.Field1.Field2.Field2")
	// @Mapping(target="AnotherField4", source="in.Field2.Field1.Field1")
	Structures2(in *input.StructuresMapping2) output.StructuresMapping2

	// @Mapping(target="AnotherField3", source="in1")
	// @Mapping(target="AnotherField4", source="in2")
	Structures3(in1 *common.Common, in2 common.Common) output.StructuresMapping2

	// @Mapping(target="String", source="in1")
	// @Mapping(target="PtrString", source="in1")
	// @Mapping(target="Complex128", source="in2")
	// @Mapping(target="PtrComplex128", source="in2")
	// @Mapping(target="Uint64", source="in3")
	// @Mapping(target="PtrUint64", source="in3")
	Structures4(in1 string, in2 *complex128, in3 *uint64) output.Primitives

	TimeMapping(t time.Time) time.Time
}

BaseStructuresMapper example of base structures mapper @Mapper

type BaseStructuresMapperImpl

type BaseStructuresMapperImpl struct{}

func (BaseStructuresMapperImpl) Structures1

func (BaseStructuresMapperImpl) Structures2

func (BaseStructuresMapperImpl) Structures3

func (BaseStructuresMapperImpl) Structures4

func (_this_ BaseStructuresMapperImpl) Structures4(in1 string, in2 *complex128, in3 *uint64) _imp_2.Primitives

func (BaseStructuresMapperImpl) TimeMapping added in v0.0.18

func (_this_ BaseStructuresMapperImpl) TimeMapping(t _imp_1.Time) _imp_1.Time

type ConstantMapper

type ConstantMapper interface {
	// Primitives
	// @Mapping(target="PtrFloat32", const="3.14")
	// @Mapping(target="Float32", const="3.14")
	// @Mapping(target="String", const="Hello")
	// @Mapping(target="PtrString", const="World")
	Primitives() output.Primitives
}

ConstantMapper example for constant mapping @Mapper

type ConstantMapperImpl

type ConstantMapperImpl struct{}

func (ConstantMapperImpl) Primitives

func (_this_ ConstantMapperImpl) Primitives() _imp_2.Primitives

type FunctionMapper

type FunctionMapper interface {
	// @Mapping(target="AnotherField1", this="fieldToField(
	//		in.Field1.Field1.Field1,
	//		in.Field1.Field1.Field2,
	//		in.Field1.Field2.Field1,
	//		in.Field1.Field2.Field2)")
	Function1(in *input.StructuresMapping2) output.StructuresMapping2

	// @Mapping(target="AnotherField1", func="fieldToField(
	//		in.Field1.Field1.Field1,
	//		in.Field1.Field1.Field2,
	//		in.Field1.Field2.Field1,
	//		in.Field1.Field2.Field2)")
	Function2(in *input.StructuresMapping2) output.StructuresMapping2
	// contains filtered or unexported methods
}

@Mapper

type FunctionMapperImpl

type FunctionMapperImpl struct{}

func (FunctionMapperImpl) Function1

func (FunctionMapperImpl) Function2

type Inner

type Inner struct {
	PtrBool *bool
	// contains filtered or unexported fields
}

type LinkToLinkToThisFileStruct

type LinkToLinkToThisFileStruct LinkToThisFileStruct

type LinkToThisFileStruct

type LinkToThisFileStruct ThisFileStruct

type MapMapping

type MapMapping interface {
	// @MapMapping(target="Map", source="in.Map", this="genMapper")
	Function1(in input.MapStruct) output.MapStruct

	Function2(mapStruct input.MapStruct2) output.MapStruct2
	// contains filtered or unexported methods
}

@Mapper

type MapMappingImpl

type MapMappingImpl struct{}

func (MapMappingImpl) Function1

func (_this_ MapMappingImpl) Function1(in _imp_3.MapStruct) _imp_2.MapStruct

func (MapMappingImpl) Function2

func (_this_ MapMappingImpl) Function2(mapStruct _imp_3.MapStruct2) _imp_2.MapStruct2

type PrimitivesMapper

type PrimitivesMapper interface {
	Primitives(in *input.Primitives) (out output.Primitives)
	ConvertMethod(*Inner, ThisFileStruct) output.Primitives
	ConvertMethod2(Inner, *ThisFileStruct) output.Primitives
}

PrimitivesMapper example of primitives mapper @Mapper

type PrimitivesMapperImpl

type PrimitivesMapperImpl struct{}

func (PrimitivesMapperImpl) ConvertMethod

func (_this_ PrimitivesMapperImpl) ConvertMethod(in0 *Inner, in1 ThisFileStruct) _imp_2.Primitives

func (PrimitivesMapperImpl) ConvertMethod2

func (_this_ PrimitivesMapperImpl) ConvertMethod2(in0 Inner, in1 *ThisFileStruct) _imp_2.Primitives

func (PrimitivesMapperImpl) Primitives

func (_this_ PrimitivesMapperImpl) Primitives(in *_imp_3.Primitives) _imp_2.Primitives

type SliceMapping

type SliceMapping interface {
	// @Mapping(target="Slice", func="sliceInOut(in.Slice)")
	Function1(in *input.SliceStruct) output.SliceStruct

	// @SliceMapping(target="Slice", source="in.Slice", this="genMapper")
	Function2(in *input.SliceStruct) output.SliceStruct

	// @SliceMapping(target="Slice", source="in.Slice", this="genMapper2")
	Function3(in *input.SliceStruct2) output.SliceStruct2
	// contains filtered or unexported methods
}

@Mapper

type SliceMappingImpl

type SliceMappingImpl struct{}

func (SliceMappingImpl) Function1

func (_this_ SliceMappingImpl) Function1(in *_imp_3.SliceStruct) _imp_2.SliceStruct

func (SliceMappingImpl) Function2

func (_this_ SliceMappingImpl) Function2(in *_imp_3.SliceStruct) _imp_2.SliceStruct

func (SliceMappingImpl) Function3

func (_this_ SliceMappingImpl) Function3(in *_imp_3.SliceStruct2) _imp_2.SliceStruct2

type ThisFileStruct

type ThisFileStruct struct {
	Field         string
	String        string
	PtrUnt64      string
	PtrFloat64    *string
	PtrComplex128 *string
	PtrComplex64  string
	PtrInt        int
	Int           *int
	Float32       *int
	Bool          string
}

Jump to

Keyboard shortcuts

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