Documentation
¶
Index ¶
Constants ¶
View Source
const ( StructTagKey = "param" // StructTagDelimiter used to separate items in struct tags. StructTagDelimiter = "," // StructTagSeparator used for defining key/value flags in struct tags. StructTagSeparator = "=" // StructTagFlagOmitEmpty used to determine whether the field can be omitted if it's Value is empty or not. StructTagFlagOmitEmpty = "omitempty" )
Variables ¶
This section is empty.
Functions ¶
func MarshalParams ¶
Types ¶
type ParamsMarshaler ¶
type StructTag ¶
type StructTag struct { // Key name which is the first item of a struct tag Key string // Flags OmitEmpty bool }
StructTag stores information about the struct tags which includes the name of the Key and optional flags like `omitempty`.
func ParseStructTag ¶
ParseStructTag returns a pointer to a StructTag object holding the information resulted from parsing the s string as a struct tag.
type StructTagFlag ¶
StructTagFlag holds information about flags defined for a struct tag in a Key/Value format.
func ParseStructTagFlag ¶
func ParseStructTagFlag(s string) (*StructTagFlag, error)
ParseStructTagFlag returns a pointer to a StructTagFlag object holding the information resulted from parsing the s string as a struct tag flag.
func (StructTagFlag) IsValid ¶
func (f StructTagFlag) IsValid() bool
IsValid considers f StructTagFlag valid if Key field is a non-empty string.
Click to show internal directories.
Click to hide internal directories.