cmd

package
v0.0.0-...-7c0f2aa Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncGenerator

type FuncGenerator interface {
	Generate(t *types.Named, cm *packages.CommentMarkers) (map[string]interface{}, error)
}

func NewProducers

func NewProducers(cache *packages.Cache, im *packages.Imports) FuncGenerator

type FuncGeneratorChain

type FuncGeneratorChain []FuncGenerator

func (FuncGeneratorChain) Generate

func (gc FuncGeneratorChain) Generate(t *types.Named, cm *packages.CommentMarkers) (map[string]interface{}, error)

type Functions

type Functions struct {
	SourcePackagePath string
	NewGeneratorFns   []NewFuncGeneratorFn
	// contains filtered or unexported fields
}

func NewFunctions

func NewFunctions(c *packages.Cache, i *packages.Imports, sourcePkgPath string, opts ...FunctionsOption) *Functions

func (*Functions) Run

func (f *Functions) Run() (map[string]interface{}, error)

type FunctionsOption

type FunctionsOption func(*Functions)

func WithNewFuncGeneratorFns

func WithNewFuncGeneratorFns(fn ...NewFuncGeneratorFn) FunctionsOption

type NewFuncGeneratorFn

type NewFuncGeneratorFn func(*packages.Cache, *packages.Imports) FuncGenerator

type Producers

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

Producers generates a function for every merged type of the given type that will let you produce those remote types from the local one.

func (*Producers) Generate

func (p *Producers) Generate(source *types.Named, cm *packages.CommentMarkers) (map[string]interface{}, error)

type Type

type Type struct {
	Imports         *packages.Imports
	Cache           *packages.Cache
	Generator       TypeGenerator
	FlattenerOption types.FlattenerOption
}

func NewType

func NewType(im *packages.Imports, cache *packages.Cache, gen TypeGenerator, opts ...TypeOption) *Type

func (*Type) Run

func (t *Type) Run() (string, error)

type TypeGenerator

type TypeGenerator interface {
	Generate() (*types.Named, *packages.CommentMarkers, error)
}

type TypeOption

type TypeOption func(*Type)

func WithFlattenerOption

func WithFlattenerOption(fo types.FlattenerOption) TypeOption

Jump to

Keyboard shortcuts

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