Documentation ¶
Overview ¶
Package gtag providing tag content storing for struct.
Note that calling functions of this package is concurrently safe.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get retrieves and returns the stored tag content for specified name.
func Parse ¶
Parse parses and returns the content by replacing all tag name variable to its content for given `content`. Eg: If "Demo:content" in tag mapping, Parse(`This is {Demo}`) -> `This is content`.
func Set ¶
func Set(name, value string)
Set sets tag content for specified name.
Example ¶
package main import ( "fmt" "easyscdp.com/gogf/gf/frame/g" "easyscdp.com/gogf/gf/util/gmeta" "easyscdp.com/gogf/gf/util/gtag" ) func main() { type User struct { g.Meta `name:"User Struct" description:"{UserDescription}"` } gtag.Sets(g.MapStrStr{ `UserDescription`: `This is a demo struct named "User Struct"`, }) fmt.Println(gmeta.Get(User{}, `description`)) }
Output: This is a demo struct named "User Struct"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.