Documentation
¶
Overview ¶
Package annotations finds and parses annotations in the comments to an interface or method. An annotation must have the following format: @Name{"key1":"value1", "key2": "value2", ...}, i.e. it begins with an @ characater, followed by a name followed by a valid json object.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseInterfaceAnnotations ¶
func ParseInterfaceAnnotations(i parse.Interface) (map[string]InterfaceAnnotation, error)
Returns a map of annotations found in the comments of the given interface. The map keys are the annotation names and the values are instances of InterfaceAnnotation.
func ParseJSONAnnotation ¶
Parses the annotation as JSON and stores the result in the "result" parameter, which should usually be a pointer to a struct or map.
Types ¶
type InterfaceAnnotation ¶
type InterfaceAnnotation struct {
// Name of the annotation
Name string
// The annotation on the interface
Annotation string
// Annotations on the interface methods.
// Slice has the same length as parse.Interface.Methods.
// Contain empty string for methods without an annotation.
MethodAnnotations []string
}
An annotation on an interface.
Click to show internal directories.
Click to hide internal directories.