translate

package
v0.0.0-...-fdde285 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = code.DefaultConfig
View Source
var ErrNoImports = code.ErrNoImports

Functions

This section is empty.

Types

type Struct

type Struct struct {
	Name    string
	Package *tinypkg.Package
	Fields  []StructField
}

func (*Struct) OnWalk

func (s *Struct) OnWalk(use func(*tinypkg.Symbol) error) error

type StructField

type StructField struct {
	Name     string
	Type     tinypkg.Node
	Tags     []string
	Embedded bool
}

type Translator

type Translator struct {
	*resolve.Tracker
	Resolver *resolve.Resolver
	Config   *code.Config
	// contains filtered or unexported fields
}

func NewTranslator

func NewTranslator(config *code.Config) *Translator

func (*Translator) ExtractProviderInterface

func (t *Translator) ExtractProviderInterface(here *tinypkg.Package, name string) *code.CodeEmitter

func (*Translator) TranslateToInterface

func (t *Translator) TranslateToInterface(here *tinypkg.Package, ob interface{}, name string) *code.CodeEmitter

TranslateToInterface translates to interface from concrete struct

func (*Translator) TranslateToRunner

func (t *Translator) TranslateToRunner(here *tinypkg.Package, fn interface{}, name string, provider *tinypkg.Var) *code.CodeEmitter

func (*Translator) TranslateToStruct

func (t *Translator) TranslateToStruct(here *tinypkg.Package, ob interface{}, name string) *code.CodeEmitter

TranslateToStruct translates to struct from function or concrete struct

Jump to

Keyboard shortcuts

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