Documentation
¶
Index ¶
- type Namespace
- func (ns *Namespace) KindIs(target string, src interface{}) bool
- func (ns *Namespace) KindOf(src interface{}) string
- func (ns *Namespace) TypeIs(target string, src interface{}) bool
- func (ns *Namespace) TypeIsLike(target string, src interface{}) bool
- func (ns *Namespace) TypeOf(src interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace defines the methods for reflect to be used as template functions.
func (*Namespace) KindIs ¶
KindIs
Returns true if the target and source types match.
Returns `true` Example: {{ kindIs "int" 123 }}
func (*Namespace) KindOf ¶
KindOf
Returns the type of the given `interface` as a string.
Example: {{ kindOf 123 }} Returns: `int`
func (*Namespace) TypeIs ¶
TypeIs
Similar to `kindIs` but its used for types, instead of primitives.
Example: {{ typeOf "domain.Post" .post }} Returns: `true`
func (*Namespace) TypeIsLike ¶
TypeIsLike
Similar to `kindIs` but its used for types, instead of primitives.
Example: {{ typeOf "domain.Post" .post }} Returns: true
Click to show internal directories.
Click to hide internal directories.