var Default … type Validator … type Format … type Registry … type knownFormat … type NameNormalizer … // DefaultNameNormalizer removes all dashes func DefaultNameNormalizer(name string) string { … } type defaultFormats … // NewFormats creates a new formats registry seeded with the values from the default func NewFormats() Registry { … } // NewSeededFormats creates a new formats registry func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry { … } // Add adds a new format, return true if this was a new item instead of a replacement func (f *defaultFormats) Add(name string, strfmt Format, validator Validator) bool { … } // GetType gets the type for the specified name func (f *defaultFormats) GetType(name string) (reflect.Type, bool) { … } // DelByName removes the format by the specified name, returns true when an item was actually removed func (f *defaultFormats) DelByName(name string) bool { … } // DelByFormat removes the specified format, returns true when an item was actually removed func (f *defaultFormats) DelByFormat(strfmt Format) bool { … } // ContainsName returns true if this registry contains the specified name func (f *defaultFormats) ContainsName(name string) bool { … } // ContainsFormat returns true if this registry contains the specified format func (f *defaultFormats) ContainsFormat(strfmt Format) bool { … } // Validates passed data against format. // // Note that the format name is automatically normalized, e.g. one may // use "date-time" to use the "datetime" format validator. func (f *defaultFormats) Validates(name, data string) bool { … } // Parse a string into the appropriate format representation type. // // E.g. parsing a string a "date" will return a Date type. func (f *defaultFormats) Parse(name, data string) (interface{ … }