mapper

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build added in v0.0.4

func Build(cfg *Config) (*ast.Mapper, error)

func BuildPackage added in v0.0.4

func BuildPackage(cfg *PackageConfig) (*ast.Package, error)

BuildPackage builds the package with mappers

Types

type Config added in v0.0.4

type Config struct {
	Name     string
	FromName string
	FromType Type
	ToType   Type
}

TODO: Make more generic

type OpaqueType added in v0.0.4

type OpaqueType struct {
	Name_ string
}

func (*OpaqueType) BuildMapper added in v0.0.4

func (t *OpaqueType) BuildMapper(args ProviderList) (node.Node, error)

func (*OpaqueType) FindAccessor added in v0.0.4

func (t *OpaqueType) FindAccessor(name string, typeName string) string

func (*OpaqueType) IsPointer added in v0.0.4

func (t *OpaqueType) IsPointer() bool

func (*OpaqueType) Name added in v0.0.4

func (t *OpaqueType) Name() string

type PackageConfig added in v0.0.4

type PackageConfig struct {
	Name    string
	Imports []string
	Mappers []*Config
}

PackageConfig is a config for building package with mappers

type Provider added in v0.0.4

type Provider struct {
	Name string
	Type Type
}

type ProviderList added in v0.0.4

type ProviderList []Provider

func (ProviderList) FindAccessor added in v0.0.4

func (l ProviderList) FindAccessor(name string, typeName string) string

type StructType added in v0.0.4

type StructType struct {
	Name_      string
	IsPointer_ bool
	Fields     ProviderList
	Getters    ProviderList
}

func (*StructType) BuildMapper added in v0.0.4

func (t *StructType) BuildMapper(args ProviderList) (node.Node, error)

func (*StructType) FindAccessor added in v0.0.4

func (t *StructType) FindAccessor(name string, typeName string) string

func (*StructType) IsPointer added in v0.0.4

func (t *StructType) IsPointer() bool

func (*StructType) Name added in v0.0.4

func (t *StructType) Name() string

type Type

type Type interface {
	Name() string
	IsPointer() bool // TODO: Remove
	FindAccessor(name string, typeName string) string
	BuildMapper(args ProviderList) (node.Node, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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