mappers

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 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 FieldMapper

type FieldMapper struct {
	Parent    *FieldMappers
	Proto     ast.Field
	Field     types.Field
	FromProto types.FieldMapperFunc
	ToProto   types.FieldMapperFunc
}

func (*FieldMapper) GetFromProto

func (m *FieldMapper) GetFromProto(src, dest string) string

func (*FieldMapper) GetToProto

func (m *FieldMapper) GetToProto(src, dest string) string

type FieldMappers

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

func NewFieldMappers

func NewFieldMappers(mappersDict *dicts.MappersDict, fieldsDict *dicts.FieldDict) *FieldMappers

func (*FieldMappers) GetMapper

func (m *FieldMappers) GetMapper(protoField ast.Field) types.FieldMapper

type ScalarMapper

type ScalarMapper struct {
}

func (ScalarMapper) GoTypeName

func (ScalarMapper) GoTypeName(t ast.ScalarNode) string

type TypeMapper

type TypeMapper struct {
	Types  *dicts.TypeDict
	Fields *dicts.FieldDict
	// contains filtered or unexported fields
}

func NewTypeMapper

func NewTypeMapper(excludeMessageField func(field ast.Field) bool) *TypeMapper

func (*TypeMapper) FromProtoField

func (m *TypeMapper) FromProtoField(f ast.Field) (types.Field, error)

func (*TypeMapper) FromProtoType

func (m *TypeMapper) FromProtoType(t ast.Type) (result types.Type, err error)

Jump to

Keyboard shortcuts

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