Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StringOrSet ¶
type StringOrSet struct {
// contains filtered or unexported fields
}
StringOrSet is a type that holds a []string, but marshals to a []string or a string.
func Of ¶
func Of(v ...string) StringOrSet
Of will build a value that marshals to a JSON array if len(v) > 1, otherwise to a single string
func String ¶
func String(v string) StringOrSet
String will build a value that marshals to a single string
func (StringOrSet) Equal ¶
func (l StringOrSet) Equal(r StringOrSet) bool
func (*StringOrSet) IsEmpty ¶
func (s *StringOrSet) IsEmpty() bool
func (StringOrSet) MarshalJSON ¶
func (v StringOrSet) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface.
func (StringOrSet) String ¶
func (s StringOrSet) String() string
String returns the string value, or the Itoa of the int value.
func (*StringOrSet) UnmarshalJSON ¶
func (s *StringOrSet) UnmarshalJSON(value []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.
func (*StringOrSet) Value ¶
func (v *StringOrSet) Value() []string
Click to show internal directories.
Click to hide internal directories.