Documentation
¶
Overview ¶
Copyright 2018 John Deng (hi.devops.io@gmail.com).
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package annotation provides annotation support for HiBoot
Index ¶
- func Contains(object interface{}, at interface{}) (ok bool)
- func ContainsChild(input *Annotations, att interface{}) (ok bool)
- func Inject(ann *Annotation) (err error)
- func InjectAll(object interface{}) (err error)
- func InjectItems(annotations *Annotations) (err error)
- func IsAnnotation(object interface{}) (yes bool)
- type Annotation
- func FilterIn(input *Annotations, att interface{}) (annotations []*Annotation)
- func Find(input *Annotations, att interface{}) (annotation *Annotation)
- func FindAll(object interface{}, att interface{}) (annotations []*Annotation)
- func GetAnnotation(object interface{}, att interface{}) (annotation *Annotation)
- type Annotations
- type Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains(object interface{}, at interface{}) (ok bool)
Contains Has is a function that check if object is the implements of specific Annotation
func ContainsChild ¶ added in v1.3.0
func ContainsChild(input *Annotations, att interface{}) (ok bool)
ContainsChild is a function that find specific annotations.
func Inject ¶ added in v1.3.0
func Inject(ann *Annotation) (err error)
Inject inject annotations into object
func InjectAll ¶ added in v1.3.0
func InjectAll(object interface{}) (err error)
InjectAll inject annotations into object
func InjectItems ¶ added in v1.3.0
func InjectItems(annotations *Annotations) (err error)
InjectItems inject annotations into object
Types ¶
type Annotation ¶ added in v1.3.0
type Annotation struct { Field *Field Parent *types.ReflectObject }
func FilterIn ¶ added in v1.3.0
func FilterIn(input *Annotations, att interface{}) (annotations []*Annotation)
Filter is a function that filter specific annotations.
func Find ¶ added in v1.3.0
func Find(input *Annotations, att interface{}) (annotation *Annotation)
Find is a function that find specific (child) annotation
func FindAll ¶ added in v1.3.0
func FindAll(object interface{}, att interface{}) (annotations []*Annotation)
Find is a function that find specific annotation.
func GetAnnotation ¶ added in v1.3.0
func GetAnnotation(object interface{}, att interface{}) (annotation *Annotation)
GetAnnotation is a function that get specific annotation of an object.
type Annotations ¶ added in v1.3.0
type Annotations struct { Items []*Annotation Children []*Annotations }
func GetAnnotations ¶ added in v1.3.0
func GetAnnotations(object interface{}) (annotations *Annotations)
GetAnnotations iterate annotations of a struct
type Field ¶ added in v1.3.0
type Field struct { StructField reflect.StructField Value reflect.Value }
annotation field