Documentation ¶
Overview ¶
Package strfmt contains custom string formats
TODO: add info on how to define and register a custom format
Index ¶
- Constants
- Variables
- func DefaultNameNormalizer(name string) string
- func IsDate(str string) bool
- func IsDateTime(str string) bool
- func IsDuration(str string) bool
- func IsHostname(str string) bool
- func IsStrictURI(str string) bool
- func IsUUID(str string) bool
- func IsUUID3(str string) bool
- func IsUUID4(str string) bool
- func IsUUID5(str string) bool
- func ParseDuration(cand string) (time.Duration, error)
- type Base64
- func (b Base64) MarshalEasyJSON(w *jwriter.Writer)
- func (b Base64) MarshalJSON() ([]byte, error)
- func (b Base64) MarshalText() ([]byte, error)
- func (b *Base64) Scan(raw interface{}) error
- func (b Base64) String() string
- func (b *Base64) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (b *Base64) UnmarshalJSON(data []byte) error
- func (b *Base64) UnmarshalText(data []byte) error
- func (b Base64) Value() (driver.Value, error)
- type CreditCard
- func (u CreditCard) MarshalEasyJSON(w *jwriter.Writer)
- func (u CreditCard) MarshalJSON() ([]byte, error)
- func (u CreditCard) MarshalText() ([]byte, error)
- func (u *CreditCard) Scan(raw interface{}) error
- func (u CreditCard) String() string
- func (u *CreditCard) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *CreditCard) UnmarshalJSON(data []byte) error
- func (u *CreditCard) UnmarshalText(data []byte) error
- func (u CreditCard) Value() (driver.Value, error)
- type Date
- func (t Date) MarshalEasyJSON(w *jwriter.Writer)
- func (t Date) MarshalJSON() ([]byte, error)
- func (d Date) MarshalText() ([]byte, error)
- func (d *Date) Scan(raw interface{}) error
- func (d Date) String() string
- func (t *Date) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (t *Date) UnmarshalJSON(data []byte) error
- func (d *Date) UnmarshalText(text []byte) error
- func (d Date) Value() (driver.Value, error)
- type DateTime
- func (t DateTime) MarshalEasyJSON(w *jwriter.Writer)
- func (t DateTime) MarshalJSON() ([]byte, error)
- func (t DateTime) MarshalText() ([]byte, error)
- func (t *DateTime) Scan(raw interface{}) error
- func (t DateTime) String() string
- func (t *DateTime) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (t *DateTime) UnmarshalJSON(data []byte) error
- func (t *DateTime) UnmarshalText(text []byte) error
- func (t DateTime) Value() (driver.Value, error)
- type Duration
- func (d Duration) MarshalEasyJSON(w *jwriter.Writer)
- func (d Duration) MarshalJSON() ([]byte, error)
- func (d Duration) MarshalText() ([]byte, error)
- func (d *Duration) Scan(raw interface{}) error
- func (d Duration) String() string
- func (d *Duration) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (d *Duration) UnmarshalJSON(data []byte) error
- func (d *Duration) UnmarshalText(data []byte) error
- func (d Duration) Value() (driver.Value, error)
- type Email
- func (e Email) MarshalEasyJSON(w *jwriter.Writer)
- func (e Email) MarshalJSON() ([]byte, error)
- func (e Email) MarshalText() ([]byte, error)
- func (e *Email) Scan(raw interface{}) error
- func (e Email) String() string
- func (e *Email) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (e *Email) UnmarshalJSON(data []byte) error
- func (e *Email) UnmarshalText(data []byte) error
- func (e Email) Value() (driver.Value, error)
- type Format
- type HexColor
- func (h HexColor) MarshalEasyJSON(w *jwriter.Writer)
- func (h HexColor) MarshalJSON() ([]byte, error)
- func (h HexColor) MarshalText() ([]byte, error)
- func (h *HexColor) Scan(raw interface{}) error
- func (h HexColor) String() string
- func (h *HexColor) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (h *HexColor) UnmarshalJSON(data []byte) error
- func (h *HexColor) UnmarshalText(data []byte) error
- func (h HexColor) Value() (driver.Value, error)
- type Hostname
- func (h Hostname) MarshalEasyJSON(w *jwriter.Writer)
- func (h Hostname) MarshalJSON() ([]byte, error)
- func (h Hostname) MarshalText() ([]byte, error)
- func (h *Hostname) Scan(raw interface{}) error
- func (h Hostname) String() string
- func (h *Hostname) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (h *Hostname) UnmarshalJSON(data []byte) error
- func (h *Hostname) UnmarshalText(data []byte) error
- func (h Hostname) Value() (driver.Value, error)
- type IPv4
- func (u IPv4) MarshalEasyJSON(w *jwriter.Writer)
- func (u IPv4) MarshalJSON() ([]byte, error)
- func (u IPv4) MarshalText() ([]byte, error)
- func (u *IPv4) Scan(raw interface{}) error
- func (u IPv4) String() string
- func (u *IPv4) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *IPv4) UnmarshalJSON(data []byte) error
- func (u *IPv4) UnmarshalText(data []byte) error
- func (u IPv4) Value() (driver.Value, error)
- type IPv6
- func (u IPv6) MarshalEasyJSON(w *jwriter.Writer)
- func (u IPv6) MarshalJSON() ([]byte, error)
- func (u IPv6) MarshalText() ([]byte, error)
- func (u *IPv6) Scan(raw interface{}) error
- func (u IPv6) String() string
- func (u *IPv6) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *IPv6) UnmarshalJSON(data []byte) error
- func (u *IPv6) UnmarshalText(data []byte) error
- func (u IPv6) Value() (driver.Value, error)
- type ISBN
- func (u ISBN) MarshalEasyJSON(w *jwriter.Writer)
- func (u ISBN) MarshalJSON() ([]byte, error)
- func (u ISBN) MarshalText() ([]byte, error)
- func (u *ISBN) Scan(raw interface{}) error
- func (u ISBN) String() string
- func (u *ISBN) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *ISBN) UnmarshalJSON(data []byte) error
- func (u *ISBN) UnmarshalText(data []byte) error
- func (u ISBN) Value() (driver.Value, error)
- type ISBN10
- func (u ISBN10) MarshalEasyJSON(w *jwriter.Writer)
- func (u ISBN10) MarshalJSON() ([]byte, error)
- func (u ISBN10) MarshalText() ([]byte, error)
- func (u *ISBN10) Scan(raw interface{}) error
- func (u ISBN10) String() string
- func (u *ISBN10) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *ISBN10) UnmarshalJSON(data []byte) error
- func (u *ISBN10) UnmarshalText(data []byte) error
- func (u ISBN10) Value() (driver.Value, error)
- type ISBN13
- func (u ISBN13) MarshalEasyJSON(w *jwriter.Writer)
- func (u ISBN13) MarshalJSON() ([]byte, error)
- func (u ISBN13) MarshalText() ([]byte, error)
- func (u *ISBN13) Scan(raw interface{}) error
- func (u ISBN13) String() string
- func (u *ISBN13) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *ISBN13) UnmarshalJSON(data []byte) error
- func (u *ISBN13) UnmarshalText(data []byte) error
- func (u ISBN13) Value() (driver.Value, error)
- type MAC
- func (u MAC) MarshalEasyJSON(w *jwriter.Writer)
- func (u MAC) MarshalJSON() ([]byte, error)
- func (u MAC) MarshalText() ([]byte, error)
- func (u *MAC) Scan(raw interface{}) error
- func (u MAC) String() string
- func (u *MAC) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *MAC) UnmarshalJSON(data []byte) error
- func (u *MAC) UnmarshalText(data []byte) error
- func (u MAC) Value() (driver.Value, error)
- type NameNormalizer
- type Password
- func (r Password) MarshalEasyJSON(w *jwriter.Writer)
- func (r Password) MarshalJSON() ([]byte, error)
- func (r Password) MarshalText() ([]byte, error)
- func (r *Password) Scan(raw interface{}) error
- func (r Password) String() string
- func (r *Password) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (r *Password) UnmarshalJSON(data []byte) error
- func (r *Password) UnmarshalText(data []byte) error
- func (r Password) Value() (driver.Value, error)
- type RGBColor
- func (r RGBColor) MarshalEasyJSON(w *jwriter.Writer)
- func (r RGBColor) MarshalJSON() ([]byte, error)
- func (r RGBColor) MarshalText() ([]byte, error)
- func (r *RGBColor) Scan(raw interface{}) error
- func (r RGBColor) String() string
- func (r *RGBColor) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (r *RGBColor) UnmarshalJSON(data []byte) error
- func (r *RGBColor) UnmarshalText(data []byte) error
- func (r RGBColor) Value() (driver.Value, error)
- type Registry
- type SSN
- func (u SSN) MarshalEasyJSON(w *jwriter.Writer)
- func (u SSN) MarshalJSON() ([]byte, error)
- func (u SSN) MarshalText() ([]byte, error)
- func (u *SSN) Scan(raw interface{}) error
- func (u SSN) String() string
- func (u *SSN) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *SSN) UnmarshalJSON(data []byte) error
- func (u *SSN) UnmarshalText(data []byte) error
- func (u SSN) Value() (driver.Value, error)
- type URI
- func (u URI) MarshalEasyJSON(w *jwriter.Writer)
- func (u URI) MarshalJSON() ([]byte, error)
- func (u URI) MarshalText() ([]byte, error)
- func (u *URI) Scan(raw interface{}) error
- func (u URI) String() string
- func (u *URI) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *URI) UnmarshalJSON(data []byte) error
- func (u *URI) UnmarshalText(data []byte) error
- func (u URI) Value() (driver.Value, error)
- type UUID
- func (u UUID) MarshalEasyJSON(w *jwriter.Writer)
- func (u UUID) MarshalJSON() ([]byte, error)
- func (u UUID) MarshalText() ([]byte, error)
- func (u *UUID) Scan(raw interface{}) error
- func (u UUID) String() string
- func (u *UUID) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *UUID) UnmarshalJSON(data []byte) error
- func (u *UUID) UnmarshalText(data []byte) error
- func (u UUID) Value() (driver.Value, error)
- type UUID3
- func (u UUID3) MarshalEasyJSON(w *jwriter.Writer)
- func (u UUID3) MarshalJSON() ([]byte, error)
- func (u UUID3) MarshalText() ([]byte, error)
- func (u *UUID3) Scan(raw interface{}) error
- func (u UUID3) String() string
- func (u *UUID3) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *UUID3) UnmarshalJSON(data []byte) error
- func (u *UUID3) UnmarshalText(data []byte) error
- func (u UUID3) Value() (driver.Value, error)
- type UUID4
- func (u UUID4) MarshalEasyJSON(w *jwriter.Writer)
- func (u UUID4) MarshalJSON() ([]byte, error)
- func (u UUID4) MarshalText() ([]byte, error)
- func (u *UUID4) Scan(raw interface{}) error
- func (u UUID4) String() string
- func (u *UUID4) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *UUID4) UnmarshalJSON(data []byte) error
- func (u *UUID4) UnmarshalText(data []byte) error
- func (u UUID4) Value() (driver.Value, error)
- type UUID5
- func (u UUID5) MarshalEasyJSON(w *jwriter.Writer)
- func (u UUID5) MarshalJSON() ([]byte, error)
- func (u UUID5) MarshalText() ([]byte, error)
- func (u *UUID5) Scan(raw interface{}) error
- func (u UUID5) String() string
- func (u *UUID5) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (u *UUID5) UnmarshalJSON(data []byte) error
- func (u *UUID5) UnmarshalText(data []byte) error
- func (u UUID5) Value() (driver.Value, error)
- type Validator
Constants ¶
const ( // RFC3339FullDate represents a full-date as specified by RFC3339 // See: http://goo.gl/xXOvVd RFC3339FullDate = "2006-01-02" // DatePattern pattern to match for the date format from http://tools.ietf.org/html/rfc3339#section-5.6 DatePattern = `^([0-9]{4})-([0-9]{2})-([0-9]{2})` )
const ( // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114 // A string instance is valid against this attribute if it is a valid // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. // http://tools.ietf.org/html/rfc1034#section-3.5 // <digit> ::= any one of the ten digits 0 through 9 // var digit = /[0-9]/; // <letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case // var letter = /[a-zA-Z]/; // <let-dig> ::= <letter> | <digit> // var letDig = /[0-9a-zA-Z]/; // <let-dig-hyp> ::= <let-dig> | "-" // var letDigHyp = /[-0-9a-zA-Z]/; // <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> // var ldhStr = /[-0-9a-zA-Z]+/; // <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] // var label = /[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?/; // <subdomain> ::= <label> | <subdomain> "." <label> // var subdomain = /^[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?(\.[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?)*$/; // <domain> ::= <subdomain> | " " HostnamePattern = `^[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?(\.[a-zA-Z](([-0-9a-zA-Z]+)?[0-9a-zA-Z])?)*$` // UUIDPattern Regex for UUID that allows uppercase UUIDPattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` // UUID3Pattern Regex for UUID3 that allows uppercase UUID3Pattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$` // UUID4Pattern Regex for UUID4 that allows uppercase UUID4Pattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$` // UUID5Pattern Regex for UUID5 that allows uppercase UUID5Pattern = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$` )
const ( // RFC3339Millis represents a ISO8601 format to millis instead of to nanos RFC3339Millis = "2006-01-02T15:04:05.000Z07:00" // DateTimePattern pattern to match for the date-time format from http://tools.ietf.org/html/rfc3339#section-5.6 DateTimePattern = `^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$` )
Variables ¶
var Default = NewSeededFormats(nil, nil)
Default is the default formats registry
Functions ¶
func DefaultNameNormalizer ¶
DefaultNameNormalizer removes all dashes
func IsDateTime ¶
IsDateTime returns true when the string is a valid date-time
func IsDuration ¶
IsDuration returns true if the provided string is a valid duration
func IsHostname ¶
IsHostname returns true when the string is a valid hostname
func IsStrictURI ¶
IsStrictURI returns true when the string is an absolute URI
Types ¶
type Base64 ¶
type Base64 []byte
Base64 represents a base64 encoded string
swagger:strfmt byte
func (Base64) MarshalEasyJSON ¶
func (Base64) MarshalJSON ¶
func (Base64) MarshalText ¶
MarshalText turns this instance into text
func (*Base64) UnmarshalEasyJSON ¶
func (*Base64) UnmarshalJSON ¶
func (*Base64) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type CreditCard ¶
type CreditCard string
CreditCard represents a credit card string format
swagger:strfmt creditcard
func (CreditCard) MarshalEasyJSON ¶
func (u CreditCard) MarshalEasyJSON(w *jwriter.Writer)
func (CreditCard) MarshalJSON ¶
func (u CreditCard) MarshalJSON() ([]byte, error)
func (CreditCard) MarshalText ¶
func (u CreditCard) MarshalText() ([]byte, error)
MarshalText turns this instance into text
func (*CreditCard) Scan ¶
func (u *CreditCard) Scan(raw interface{}) error
Scan read a value from a database driver
func (CreditCard) String ¶
func (u CreditCard) String() string
func (*CreditCard) UnmarshalEasyJSON ¶
func (u *CreditCard) UnmarshalEasyJSON(in *jlexer.Lexer)
func (*CreditCard) UnmarshalJSON ¶
func (u *CreditCard) UnmarshalJSON(data []byte) error
func (*CreditCard) UnmarshalText ¶
func (u *CreditCard) UnmarshalText(data []byte) error
UnmarshalText hydrates this instance from text
type Date ¶
Date represents a date from the API
swagger:strfmt date
func (Date) MarshalEasyJSON ¶
func (Date) MarshalJSON ¶
func (Date) MarshalText ¶
MarshalText serializes this date type to string
func (*Date) UnmarshalEasyJSON ¶
func (*Date) UnmarshalJSON ¶
func (*Date) UnmarshalText ¶
UnmarshalText parses a text representation into a date type
type DateTime ¶
DateTime is a time but it serializes to ISO8601 format with millis It knows how to read 3 different variations of a RFC3339 date time. Most API's we encounter want either millisecond or second precision times. This just tries to make it worry-free.
swagger:strfmt date-time
func NewDateTime ¶
func NewDateTime() DateTime
NewDateTime is a representation of zero value for DateTime type
func ParseDateTime ¶
ParseDateTime parses a string that represents an ISO8601 time or a unix epoch
func (DateTime) MarshalEasyJSON ¶
func (DateTime) MarshalJSON ¶
func (DateTime) MarshalText ¶
MarshalText implements the text marshaller interface
func (*DateTime) UnmarshalEasyJSON ¶
func (*DateTime) UnmarshalJSON ¶
func (*DateTime) UnmarshalText ¶
UnmarshalText implements the text unmarshaller interface
type Duration ¶
Duration represents a duration
swagger:strfmt duration
func (Duration) MarshalEasyJSON ¶
func (Duration) MarshalJSON ¶
func (Duration) MarshalText ¶
MarshalText turns this instance into text
func (*Duration) UnmarshalEasyJSON ¶
func (*Duration) UnmarshalJSON ¶
func (*Duration) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type Email ¶
type Email string
Email represents the email string format as specified by the json schema spec
swagger:strfmt email
func (Email) MarshalEasyJSON ¶
func (Email) MarshalJSON ¶
func (Email) MarshalText ¶
MarshalText turns this instance into text
func (*Email) UnmarshalEasyJSON ¶
func (*Email) UnmarshalJSON ¶
func (*Email) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type Format ¶
type Format interface { String() string encoding.TextMarshaler encoding.TextUnmarshaler }
Format represents a string format
type HexColor ¶
type HexColor string
HexColor represents a hex color string format
swagger:strfmt hexcolor
func (HexColor) MarshalEasyJSON ¶
func (HexColor) MarshalJSON ¶
func (HexColor) MarshalText ¶
MarshalText turns this instance into text
func (*HexColor) UnmarshalEasyJSON ¶
func (*HexColor) UnmarshalJSON ¶
func (*HexColor) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type Hostname ¶
type Hostname string
Hostname represents the hostname string format as specified by the json schema spec
swagger:strfmt hostname
func (Hostname) MarshalEasyJSON ¶
func (Hostname) MarshalJSON ¶
func (Hostname) MarshalText ¶
MarshalText turns this instance into text
func (*Hostname) UnmarshalEasyJSON ¶
func (*Hostname) UnmarshalJSON ¶
func (*Hostname) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type IPv4 ¶
type IPv4 string
IPv4 represents an IP v4 address
swagger:strfmt ipv4
func (IPv4) MarshalEasyJSON ¶
func (IPv4) MarshalJSON ¶
func (IPv4) MarshalText ¶
MarshalText turns this instance into text
func (*IPv4) UnmarshalEasyJSON ¶
func (*IPv4) UnmarshalJSON ¶
func (*IPv4) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type IPv6 ¶
type IPv6 string
IPv6 represents an IP v6 address
swagger:strfmt ipv6
func (IPv6) MarshalEasyJSON ¶
func (IPv6) MarshalJSON ¶
func (IPv6) MarshalText ¶
MarshalText turns this instance into text
func (*IPv6) UnmarshalEasyJSON ¶
func (*IPv6) UnmarshalJSON ¶
func (*IPv6) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type ISBN ¶
type ISBN string
ISBN represents an isbn string format
swagger:strfmt isbn
func (ISBN) MarshalEasyJSON ¶
func (ISBN) MarshalJSON ¶
func (ISBN) MarshalText ¶
MarshalText turns this instance into text
func (*ISBN) UnmarshalEasyJSON ¶
func (*ISBN) UnmarshalJSON ¶
func (*ISBN) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type ISBN10 ¶
type ISBN10 string
ISBN10 represents an isbn 10 string format
swagger:strfmt isbn10
func (ISBN10) MarshalEasyJSON ¶
func (ISBN10) MarshalJSON ¶
func (ISBN10) MarshalText ¶
MarshalText turns this instance into text
func (*ISBN10) UnmarshalEasyJSON ¶
func (*ISBN10) UnmarshalJSON ¶
func (*ISBN10) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type ISBN13 ¶
type ISBN13 string
ISBN13 represents an isbn 13 string format
swagger:strfmt isbn13
func (ISBN13) MarshalEasyJSON ¶
func (ISBN13) MarshalJSON ¶
func (ISBN13) MarshalText ¶
MarshalText turns this instance into text
func (*ISBN13) UnmarshalEasyJSON ¶
func (*ISBN13) UnmarshalJSON ¶
func (*ISBN13) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type MAC ¶
type MAC string
MAC represents a 48 bit MAC address
swagger:strfmt mac
func (MAC) MarshalEasyJSON ¶
func (MAC) MarshalJSON ¶
func (MAC) MarshalText ¶
MarshalText turns this instance into text
func (*MAC) UnmarshalEasyJSON ¶
func (*MAC) UnmarshalJSON ¶
func (*MAC) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type NameNormalizer ¶
NameNormalizer is a function that normalizes a format name
type Password ¶
type Password string
Password represents a password. This has no validations and is mainly used as a marker for UI components.
swagger:strfmt password
func (Password) MarshalEasyJSON ¶
func (Password) MarshalJSON ¶
func (Password) MarshalText ¶
MarshalText turns this instance into text
func (*Password) UnmarshalEasyJSON ¶
func (*Password) UnmarshalJSON ¶
func (*Password) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type RGBColor ¶
type RGBColor string
RGBColor represents a RGB color string format
swagger:strfmt rgbcolor
func (RGBColor) MarshalEasyJSON ¶
func (RGBColor) MarshalJSON ¶
func (RGBColor) MarshalText ¶
MarshalText turns this instance into text
func (*RGBColor) UnmarshalEasyJSON ¶
func (*RGBColor) UnmarshalJSON ¶
func (*RGBColor) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type Registry ¶
type Registry interface { Add(string, Format, Validator) bool DelByName(string) bool GetType(string) (reflect.Type, bool) ContainsName(string) bool Validates(string, string) bool Parse(string, string) (interface{}, error) MapStructureHookFunc() mapstructure.DecodeHookFunc }
Registry is a registry of string formats
func NewFormats ¶
func NewFormats() Registry
NewFormats creates a new formats registry seeded with the values from the default
func NewSeededFormats ¶
func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry
NewSeededFormats creates a new formats registry
type SSN ¶
type SSN string
SSN represents a social security string format
swagger:strfmt ssn
func (SSN) MarshalEasyJSON ¶
func (SSN) MarshalJSON ¶
func (SSN) MarshalText ¶
MarshalText turns this instance into text
func (*SSN) UnmarshalEasyJSON ¶
func (*SSN) UnmarshalJSON ¶
func (*SSN) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type URI ¶
type URI string
URI represents the uri string format as specified by the json schema spec
swagger:strfmt uri
func (URI) MarshalEasyJSON ¶
func (URI) MarshalJSON ¶
func (URI) MarshalText ¶
MarshalText turns this instance into text
func (*URI) UnmarshalEasyJSON ¶
func (*URI) UnmarshalJSON ¶
func (*URI) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type UUID ¶
type UUID string
UUID represents a uuid string format
swagger:strfmt uuid
func (UUID) MarshalEasyJSON ¶
func (UUID) MarshalJSON ¶
func (UUID) MarshalText ¶
MarshalText turns this instance into text
func (*UUID) UnmarshalEasyJSON ¶
func (*UUID) UnmarshalJSON ¶
func (*UUID) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type UUID3 ¶
type UUID3 string
UUID3 represents a uuid3 string format
swagger:strfmt uuid3
func (UUID3) MarshalEasyJSON ¶
func (UUID3) MarshalJSON ¶
func (UUID3) MarshalText ¶
MarshalText turns this instance into text
func (*UUID3) UnmarshalEasyJSON ¶
func (*UUID3) UnmarshalJSON ¶
func (*UUID3) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type UUID4 ¶
type UUID4 string
UUID4 represents a uuid4 string format
swagger:strfmt uuid4
func (UUID4) MarshalEasyJSON ¶
func (UUID4) MarshalJSON ¶
func (UUID4) MarshalText ¶
MarshalText turns this instance into text
func (*UUID4) UnmarshalEasyJSON ¶
func (*UUID4) UnmarshalJSON ¶
func (*UUID4) UnmarshalText ¶
UnmarshalText hydrates this instance from text
type UUID5 ¶
type UUID5 string
UUID5 represents a uuid5 string format
swagger:strfmt uuid5
func (UUID5) MarshalEasyJSON ¶
func (UUID5) MarshalJSON ¶
func (UUID5) MarshalText ¶
MarshalText turns this instance into text
func (*UUID5) UnmarshalEasyJSON ¶
func (*UUID5) UnmarshalJSON ¶
func (*UUID5) UnmarshalText ¶
UnmarshalText hydrates this instance from text