lib

package
v0.0.0-...-bccb59c Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Visiting string = "visiting"
	Done     string = "done"
)

Variables

View Source
var (
	TypeNotRegisteredError = errors.New("TypeNotRegistered")
	CircularReferenceError = errors.New("CircularReferenceDetected")
)

Functions

func GetAnnotation

func GetAnnotation(t interface{}, a Annotation) interface{}

func GetAnnotationName

func GetAnnotationName(a Annotation) string

func Provide

func Provide(t interface{}) (interface{}, error)

func RegisterAnnotation

func RegisterAnnotation(t interface{}, a Annotation)

RegisterAnnotation method mostly called by generated code to register a annotation with type

func RegisterPlugin

func RegisterPlugin(a Annotation)

func RegisterType

func RegisterType(t interface{}, f *NewFunction)

Types

type Annotation

type Annotation interface {
}

Annotation is simple annotation, it keeps annotation information for specific types.

func GetAllAnnotations

func GetAllAnnotations() (ret []Annotation)

func GetAnnotations

func GetAnnotations(t interface{}) (ret []Annotation)

func GetPluginByName

func GetPluginByName(name string) Annotation

type CompileAnnotation

type CompileAnnotation interface {
	Annotation
	Template() string
}

CompileAnnotation, annotations which will registered by annotation_gen to gen additional codes CompileAnnotation MUST be registered as an Annotation Plugin for tool annotation-gen.

type NewFunction

type NewFunction struct {
	F         func() (interface{}, error)
	Singleton bool
}

type Plugin

type Plugin struct {
}

type TargetType

type TargetType = types.Kind
const (
	TargetDefault TargetType = TargetStruct
	TargetStruct  TargetType = types.Struct
	TargetMethod  TargetType = types.Func
)

type TargetedAnnotation

type TargetedAnnotation interface {
	Target() TargetType
}

Jump to

Keyboard shortcuts

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