Documentation ¶
Index ¶
Constants ¶
View Source
const ( // JSONTag is the default JSON struct tag to use. JSONTag = "json" // SecureOption is the tag option to enable sparse encryption of a struct field. SecureOption = "secure" // HashOption is the tag option to hash a struct field of type string. Defaults to SHA256. HashOption = "hash" )
Variables ¶
This section is empty.
Functions ¶
func IgnoreField ¶
IgnoreField checks the name to see if field should be ignored.
func ParseJSONTag ¶
ParseJSONTag returns the name and options for a JSON struct field tag.
Types ¶
type Hash ¶
type Hash string
Hash provides a type for supported hash function names
const ( // HashNone is used to indicate no has function was found in the tag options. HashNone Hash = "" // HashSHA256 sets the HashOption to use sha256. This is the default. // TODO: support parsing this from the struct field tag hash option e.g. `...,hash=md5"` HashSHA256 = "sha256" )
Click to show internal directories.
Click to hide internal directories.