Documentation ¶
Index ¶
- Constants
- Variables
- func GetAnnotation(t interface{}, a Annotation) interface{}
- func GetAnnotationName(a Annotation) string
- func Provide(t interface{}) (interface{}, error)
- func RegisterAnnotation(t interface{}, a Annotation)
- func RegisterPlugin(a Annotation)
- func RegisterType(t interface{}, f *NewFunction)
- type Annotation
- type CompileAnnotation
- type NewFunction
- type Plugin
- type TargetType
- type TargetedAnnotation
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 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 TargetType ¶
const ( TargetDefault TargetType = TargetStruct TargetStruct TargetType = types.Struct TargetMethod TargetType = types.Func )
type TargetedAnnotation ¶
type TargetedAnnotation interface {
Target() TargetType
}
Click to show internal directories.
Click to hide internal directories.