generator

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRefreshableFile

func GenerateRefreshableFile(targetPackagePath, targetPackageName string, refreshableTypes RefreshableTypes) *jen.File

Types

type RefreshableType

type RefreshableType struct {
	Type         types.Type
	Imports      map[types.Type]*decl.Import
	OverrideName string
}

A RefreshableType contains all the necessary information to generate an interface and implementation for the contained internal type. It is expected that a constructed refreshable type has already handled any potential naming collisions, so users of this type are safe to use the expressions and declarations returned from it's functions if all the RefreshableTypes used they same refreshableTypeGenerator.

type RefreshableTypes

type RefreshableTypes []RefreshableType

RefreshableTypes is a container for RefreshableType which provides some convenience functions

func NewRefreshableTypes

func NewRefreshableTypes(targetPackage *packages.Package, typeSet []types.Type) (RefreshableTypes, error)

func (RefreshableTypes) Imports

func (t RefreshableTypes) Imports() decl.Imports

Imports returns an unordered list of unique imports for the analyzed fields

Jump to

Keyboard shortcuts

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