internal

package
v0.0.0-...-d91a165 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const StructTagFieldName = "transform_struct"

Variables

This section is empty.

Functions

func EmbedStructTagToSrc

func EmbedStructTagToSrc(dst, src *Struct) error

func Generate

func Generate(dst, src *Struct, opts *GenerateOption) (string, error)

func GuessFieldCorrespondings

func GuessFieldCorrespondings(dst, src *types.Struct) map[string]string

Types

type GenerateOption

type GenerateOption struct {
	TransformerType TransformerType
	TramsformerName string
	DestinationPath string
}

type Struct

type Struct struct {
	Package     string
	PackageName string
	FilePath    string
	Name        string
	IsRef       bool
}

func ResolveStruct

func ResolveStruct(packageAndName string) (*Struct, error)

func (*Struct) LiteralTypeString

func (s *Struct) LiteralTypeString() string

func (*Struct) LookupType

func (s *Struct) LookupType() (*types.Struct, error)

func (*Struct) ReturnTypeString

func (s *Struct) ReturnTypeString(withoutPackageName bool) string

type StructTag

type StructTag struct {
	DestinationField string
	Skip             bool
}

func ParseStructTag

func ParseStructTag(s string) *StructTag

type TransformerType

type TransformerType string
const (
	TransformerTypeFunction TransformerType = "function"
	TransformerTypeMethod   TransformerType = "method"
)

func TransformerTypeFromString

func TransformerTypeFromString(s string) (TransformerType, error)

Directories

Path Synopsis
fixtures
bar
foo

Jump to

Keyboard shortcuts

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