strfmt: github.com/go-openapi/strfmt Index | Files | Directories

package strfmt

import "github.com/go-openapi/strfmt"

Package strfmt contains custom string formats

TODO: add info on how to define and register a custom format

Index

Package Files

bson.go date.go default.go doc.go duration.go format.go time.go

Constants

const (
    HostnamePattern = "" /* 168 byte string literal not displayed */

    UUIDPattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$`

    UUID3Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$`

    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 = `(?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"
    // RFC3339Micro represents a ISO8601 format to micro instead of to nano
    RFC3339Micro = "2006-01-02T15:04:05.000000Z07:00"
    // ISO8601LocalTime represents a ISO8601 format to ISO8601 in local time (no timezone)
    ISO8601LocalTime = "2006-01-02T15:04:05"
    // 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}))$`
)
const (
    // RFC3339FullDate represents a full-date as specified by RFC3339
    // See: http://goo.gl/xXOvVd
    RFC3339FullDate = "2006-01-02"
)

Variables

var Default = NewSeededFormats(nil, nil)

Default is the default formats registry

var (

    // MarshalFormat sets the time resolution format used for marshaling time (set to milliseconds)
    MarshalFormat = RFC3339Millis
)

func DefaultNameNormalizer Uses

func DefaultNameNormalizer(name string) string

DefaultNameNormalizer removes all dashes

func IsBSONObjectID Uses

func IsBSONObjectID(str string) bool

IsBSONObjectID returns true when the string is a valid BSON.ObjectId

func IsDate Uses

func IsDate(str string) bool

IsDate returns true when the string is a valid date

func IsDateTime Uses

func IsDateTime(str string) bool

IsDateTime returns true when the string is a valid date-time

func IsDuration Uses

func IsDuration(str string) bool

IsDuration returns true if the provided string is a valid duration

func IsEmail Uses

func IsEmail(str string) bool

IsEmail validates an email address.

func IsHostname Uses

func IsHostname(str string) bool

IsHostname returns true when the string is a valid hostname

func IsUUID Uses

func IsUUID(str string) bool

IsUUID returns true is the string matches a UUID, upper case is allowed

func IsUUID3 Uses

func IsUUID3(str string) bool

IsUUID3 returns true is the string matches a UUID, upper case is allowed

func IsUUID4 Uses

func IsUUID4(str string) bool

IsUUID4 returns true is the string matches a UUID, upper case is allowed

func IsUUID5 Uses

func IsUUID5(str string) bool

IsUUID5 returns true is the string matches a UUID, upper case is allowed

func ParseDuration Uses

func ParseDuration(cand string) (time.Duration, error)

ParseDuration parses a duration from a string, compatible with scala duration syntax

type Base64 Uses

type Base64 []byte

Base64 represents a base64 encoded string, using URLEncoding alphabet

swagger:strfmt byte

func (*Base64) DeepCopy Uses

func (b *Base64) DeepCopy() *Base64

DeepCopy copies the receiver into a new Base64.

func (*Base64) DeepCopyInto Uses

func (b *Base64) DeepCopyInto(out *Base64)

DeepCopyInto copies the receiver and writes its value into out.

func (Base64) MarshalBSON Uses

func (b Base64) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (Base64) MarshalJSON Uses

func (b Base64) MarshalJSON() ([]byte, error)

MarshalJSON returns the Base64 as JSON

func (Base64) MarshalText Uses

func (b Base64) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*Base64) Scan Uses

func (b *Base64) Scan(raw interface{}) error

Scan read a value from a database driver

func (Base64) String Uses

func (b Base64) String() string

func (*Base64) UnmarshalBSON Uses

func (b *Base64) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*Base64) UnmarshalJSON Uses

func (b *Base64) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the Base64 from JSON

func (*Base64) UnmarshalText Uses

func (b *Base64) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (Base64) Value Uses

func (b Base64) Value() (driver.Value, error)

Value converts a value to a database driver value

type CIDR Uses

type CIDR string

CIDR represents a Classless Inter-Domain Routing notation

swagger:strfmt cidr

func (*CIDR) DeepCopy Uses

func (u *CIDR) DeepCopy() *CIDR

DeepCopy copies the receiver into a new CIDR.

func (*CIDR) DeepCopyInto Uses

func (u *CIDR) DeepCopyInto(out *CIDR)

DeepCopyInto copies the receiver and writes its value into out.

func (CIDR) MarshalBSON Uses

func (u CIDR) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (CIDR) MarshalJSON Uses

func (u CIDR) MarshalJSON() ([]byte, error)

MarshalJSON returns the CIDR as JSON

func (CIDR) MarshalText Uses

func (u CIDR) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*CIDR) Scan Uses

func (u *CIDR) Scan(raw interface{}) error

Scan read a value from a database driver

func (CIDR) String Uses

func (u CIDR) String() string

func (*CIDR) UnmarshalBSON Uses

func (u *CIDR) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*CIDR) UnmarshalJSON Uses

func (u *CIDR) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the CIDR from JSON

func (*CIDR) UnmarshalText Uses

func (u *CIDR) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (CIDR) Value Uses

func (u CIDR) Value() (driver.Value, error)

Value converts a value to a database driver value

type CreditCard Uses

type CreditCard string

CreditCard represents a credit card string format

swagger:strfmt creditcard

func (*CreditCard) DeepCopy Uses

func (u *CreditCard) DeepCopy() *CreditCard

DeepCopy copies the receiver into a new CreditCard.

func (*CreditCard) DeepCopyInto Uses

func (u *CreditCard) DeepCopyInto(out *CreditCard)

DeepCopyInto copies the receiver and writes its value into out.

func (CreditCard) MarshalBSON Uses

func (u CreditCard) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (CreditCard) MarshalJSON Uses

func (u CreditCard) MarshalJSON() ([]byte, error)

MarshalJSON returns the CreditCard as JSON

func (CreditCard) MarshalText Uses

func (u CreditCard) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*CreditCard) Scan Uses

func (u *CreditCard) Scan(raw interface{}) error

Scan read a value from a database driver

func (CreditCard) String Uses

func (u CreditCard) String() string

func (*CreditCard) UnmarshalBSON Uses

func (u *CreditCard) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*CreditCard) UnmarshalJSON Uses

func (u *CreditCard) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the CreditCard from JSON

func (*CreditCard) UnmarshalText Uses

func (u *CreditCard) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (CreditCard) Value Uses

func (u CreditCard) Value() (driver.Value, error)

Value converts a value to a database driver value

type Date Uses

type Date time.Time

Date represents a date from the API

swagger:strfmt date

func (*Date) DeepCopy Uses

func (d *Date) DeepCopy() *Date

DeepCopy copies the receiver into a new Date.

func (*Date) DeepCopyInto Uses

func (d *Date) DeepCopyInto(out *Date)

DeepCopyInto copies the receiver and writes its value into out.

func (*Date) GobDecode Uses

func (d *Date) GobDecode(data []byte) error

GobDecode implements the gob.GobDecoder interface.

func (Date) GobEncode Uses

func (d Date) GobEncode() ([]byte, error)

GobEncode implements the gob.GobEncoder interface.

func (Date) MarshalBSON Uses

func (d Date) MarshalBSON() ([]byte, error)

func (Date) MarshalBinary Uses

func (d Date) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (Date) MarshalJSON Uses

func (d Date) MarshalJSON() ([]byte, error)

MarshalJSON returns the Date as JSON

func (Date) MarshalText Uses

func (d Date) MarshalText() ([]byte, error)

MarshalText serializes this date type to string

func (*Date) Scan Uses

func (d *Date) Scan(raw interface{}) error

Scan scans a Date value from database driver type.

func (Date) String Uses

func (d Date) String() string

String converts this date into a string

func (*Date) UnmarshalBSON Uses

func (d *Date) UnmarshalBSON(data []byte) error

func (*Date) UnmarshalBinary Uses

func (d *Date) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Date) UnmarshalJSON Uses

func (d *Date) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the Date from JSON

func (*Date) UnmarshalText Uses

func (d *Date) UnmarshalText(text []byte) error

UnmarshalText parses a text representation into a date type

func (Date) Value Uses

func (d Date) Value() (driver.Value, error)

Value converts Date to a primitive value ready to written to a database.

type DateTime Uses

type DateTime time.Time

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 APIs we encounter want either millisecond or second precision times. This just tries to make it worry-free.

swagger:strfmt date-time

func NewDateTime Uses

func NewDateTime() DateTime

NewDateTime is a representation of zero value for DateTime type

func ParseDateTime Uses

func ParseDateTime(data string) (DateTime, error)

ParseDateTime parses a string that represents an ISO8601 time or a unix epoch

func (*DateTime) DeepCopy Uses

func (t *DateTime) DeepCopy() *DateTime

DeepCopy copies the receiver into a new DateTime.

func (*DateTime) DeepCopyInto Uses

func (t *DateTime) DeepCopyInto(out *DateTime)

DeepCopyInto copies the receiver and writes its value into out.

func (*DateTime) GobDecode Uses

func (t *DateTime) GobDecode(data []byte) error

GobDecode implements the gob.GobDecoder interface.

func (DateTime) GobEncode Uses

func (t DateTime) GobEncode() ([]byte, error)

GobEncode implements the gob.GobEncoder interface.

func (DateTime) MarshalBSON Uses

func (t DateTime) MarshalBSON() ([]byte, error)

MarshalBSON renders the DateTime as a BSON document

func (DateTime) MarshalBSONValue Uses

func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue is an interface implemented by types that can marshal themselves into a BSON document represented as bytes. The bytes returned must be a valid BSON document if the error is nil. Marshals a DateTime as a bsontype.DateTime, an int64 representing milliseconds since epoch.

func (DateTime) MarshalBinary Uses

func (t DateTime) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (DateTime) MarshalJSON Uses

func (t DateTime) MarshalJSON() ([]byte, error)

MarshalJSON returns the DateTime as JSON

func (DateTime) MarshalText Uses

func (t DateTime) MarshalText() ([]byte, error)

MarshalText implements the text marshaller interface

func (*DateTime) Scan Uses

func (t *DateTime) Scan(raw interface{}) error

Scan scans a DateTime value from database driver type.

func (DateTime) String Uses

func (t DateTime) String() string

String converts this time to a string

func (*DateTime) UnmarshalBSON Uses

func (t *DateTime) UnmarshalBSON(data []byte) error

UnmarshalBSON reads the DateTime from a BSON document

func (*DateTime) UnmarshalBSONValue Uses

func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error

UnmarshalBSONValue is an interface implemented by types that can unmarshal a BSON value representation of themselves. The BSON bytes and type can be assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it wishes to retain the data after returning.

func (*DateTime) UnmarshalBinary Uses

func (t *DateTime) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*DateTime) UnmarshalJSON Uses

func (t *DateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the DateTime from JSON

func (*DateTime) UnmarshalText Uses

func (t *DateTime) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller interface

func (DateTime) Value Uses

func (t DateTime) Value() (driver.Value, error)

Value converts DateTime to a primitive value ready to written to a database.

type Duration Uses

type Duration time.Duration

Duration represents a duration

Duration stores a period of time as a nanosecond count, with the largest repesentable duration being approximately 290 years.

swagger:strfmt duration

func (*Duration) DeepCopy Uses

func (d *Duration) DeepCopy() *Duration

DeepCopy copies the receiver into a new Duration.

func (*Duration) DeepCopyInto Uses

func (d *Duration) DeepCopyInto(out *Duration)

DeepCopyInto copies the receiver and writes its value into out.

func (Duration) MarshalBSON Uses

func (d Duration) MarshalBSON() ([]byte, error)

func (Duration) MarshalJSON Uses

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON returns the Duration as JSON

func (Duration) MarshalText Uses

func (d Duration) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*Duration) Scan Uses

func (d *Duration) Scan(raw interface{}) error

Scan reads a Duration value from database driver type.

func (Duration) String Uses

func (d Duration) String() string

String converts this duration to a string

func (*Duration) UnmarshalBSON Uses

func (d *Duration) UnmarshalBSON(data []byte) error

func (*Duration) UnmarshalJSON Uses

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the Duration from JSON

func (*Duration) UnmarshalText Uses

func (d *Duration) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (Duration) Value Uses

func (d Duration) Value() (driver.Value, error)

Value converts Duration to a primitive value ready to be written to a database.

type Email Uses

type Email string

Email represents the email string format as specified by the json schema spec

swagger:strfmt email

func (*Email) DeepCopy Uses

func (e *Email) DeepCopy() *Email

DeepCopy copies the receiver into a new Email.

func (*Email) DeepCopyInto Uses

func (e *Email) DeepCopyInto(out *Email)

DeepCopyInto copies the receiver and writes its value into out.

func (Email) MarshalBSON Uses

func (e Email) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (Email) MarshalJSON Uses

func (e Email) MarshalJSON() ([]byte, error)

MarshalJSON returns the Email as JSON

func (Email) MarshalText Uses

func (e Email) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*Email) Scan Uses

func (e *Email) Scan(raw interface{}) error

Scan read a value from a database driver

func (Email) String Uses

func (e Email) String() string

func (*Email) UnmarshalBSON Uses

func (e *Email) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*Email) UnmarshalJSON Uses

func (e *Email) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the Email from JSON

func (*Email) UnmarshalText Uses

func (e *Email) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (Email) Value Uses

func (e Email) Value() (driver.Value, error)

Value converts a value to a database driver value

type Format Uses

type Format interface {
    String() string
    encoding.TextMarshaler
    encoding.TextUnmarshaler
}

Format represents a string format.

All implementations of Format provide a string representation and text marshaling/unmarshaling interface to be used by encoders (e.g. encoding/json).

type HexColor Uses

type HexColor string

HexColor represents a hex color string format

swagger:strfmt hexcolor

func (*HexColor) DeepCopy Uses

func (h *HexColor) DeepCopy() *HexColor

DeepCopy copies the receiver into a new HexColor.

func (*HexColor) DeepCopyInto Uses

func (h *HexColor) DeepCopyInto(out *HexColor)

DeepCopyInto copies the receiver and writes its value into out.

func (HexColor) MarshalBSON Uses

func (h HexColor) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (HexColor) MarshalJSON Uses

func (h HexColor) MarshalJSON() ([]byte, error)

MarshalJSON returns the HexColor as JSON

func (HexColor) MarshalText Uses

func (h HexColor) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*HexColor) Scan Uses

func (h *HexColor) Scan(raw interface{}) error

Scan read a value from a database driver

func (HexColor) String Uses

func (h HexColor) String() string

func (*HexColor) UnmarshalBSON Uses

func (h *HexColor) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*HexColor) UnmarshalJSON Uses

func (h *HexColor) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the HexColor from JSON

func (*HexColor) UnmarshalText Uses

func (h *HexColor) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (HexColor) Value Uses

func (h HexColor) Value() (driver.Value, error)

Value converts a value to a database driver value

type Hostname Uses

type Hostname string

Hostname represents the hostname string format as specified by the json schema spec

swagger:strfmt hostname

func (*Hostname) DeepCopy Uses

func (h *Hostname) DeepCopy() *Hostname

DeepCopy copies the receiver into a new Hostname.

func (*Hostname) DeepCopyInto Uses

func (h *Hostname) DeepCopyInto(out *Hostname)

DeepCopyInto copies the receiver and writes its value into out.

func (Hostname) MarshalBSON Uses

func (h Hostname) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (Hostname) MarshalJSON Uses

func (h Hostname) MarshalJSON() ([]byte, error)

MarshalJSON returns the Hostname as JSON

func (Hostname) MarshalText Uses

func (h Hostname) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*Hostname) Scan Uses

func (h *Hostname) Scan(raw interface{}) error

Scan read a value from a database driver

func (Hostname) String Uses

func (h Hostname) String() string

func (*Hostname) UnmarshalBSON Uses

func (h *Hostname) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*Hostname) UnmarshalJSON Uses

func (h *Hostname) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the Hostname from JSON

func (*Hostname) UnmarshalText Uses

func (h *Hostname) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (Hostname) Value Uses

func (h Hostname) Value() (driver.Value, error)

Value converts a value to a database driver value

type IPv4 Uses

type IPv4 string

IPv4 represents an IP v4 address

swagger:strfmt ipv4

func (*IPv4) DeepCopy Uses

func (u *IPv4) DeepCopy() *IPv4

DeepCopy copies the receiver into a new IPv4.

func (*IPv4) DeepCopyInto Uses

func (u *IPv4) DeepCopyInto(out *IPv4)

DeepCopyInto copies the receiver and writes its value into out.

func (IPv4) MarshalBSON Uses

func (u IPv4) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (IPv4) MarshalJSON Uses

func (u IPv4) MarshalJSON() ([]byte, error)

MarshalJSON returns the IPv4 as JSON

func (IPv4) MarshalText Uses

func (u IPv4) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*IPv4) Scan Uses

func (u *IPv4) Scan(raw interface{}) error

Scan read a value from a database driver

func (IPv4) String Uses

func (u IPv4) String() string

func (*IPv4) UnmarshalBSON Uses

func (u *IPv4) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*IPv4) UnmarshalJSON Uses

func (u *IPv4) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the IPv4 from JSON

func (*IPv4) UnmarshalText Uses

func (u *IPv4) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (IPv4) Value Uses

func (u IPv4) Value() (driver.Value, error)

Value converts a value to a database driver value

type IPv6 Uses

type IPv6 string

IPv6 represents an IP v6 address

swagger:strfmt ipv6

func (*IPv6) DeepCopy Uses

func (u *IPv6) DeepCopy() *IPv6

DeepCopy copies the receiver into a new IPv6.

func (*IPv6) DeepCopyInto Uses

func (u *IPv6) DeepCopyInto(out *IPv6)

DeepCopyInto copies the receiver and writes its value into out.

func (IPv6) MarshalBSON Uses

func (u IPv6) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (IPv6) MarshalJSON Uses

func (u IPv6) MarshalJSON() ([]byte, error)

MarshalJSON returns the IPv6 as JSON

func (IPv6) MarshalText Uses

func (u IPv6) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*IPv6) Scan Uses

func (u *IPv6) Scan(raw interface{}) error

Scan read a value from a database driver

func (IPv6) String Uses

func (u IPv6) String() string

func (*IPv6) UnmarshalBSON Uses

func (u *IPv6) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*IPv6) UnmarshalJSON Uses

func (u *IPv6) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the IPv6 from JSON

func (*IPv6) UnmarshalText Uses

func (u *IPv6) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (IPv6) Value Uses

func (u IPv6) Value() (driver.Value, error)

Value converts a value to a database driver value

type ISBN Uses

type ISBN string

ISBN represents an isbn string format

swagger:strfmt isbn

func (*ISBN) DeepCopy Uses

func (u *ISBN) DeepCopy() *ISBN

DeepCopy copies the receiver into a new ISBN.

func (*ISBN) DeepCopyInto Uses

func (u *ISBN) DeepCopyInto(out *ISBN)

DeepCopyInto copies the receiver and writes its value into out.

func (ISBN) MarshalBSON Uses

func (u ISBN) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (ISBN) MarshalJSON Uses

func (u ISBN) MarshalJSON() ([]byte, error)

MarshalJSON returns the ISBN as JSON

func (ISBN) MarshalText Uses

func (u ISBN) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*ISBN) Scan Uses

func (u *ISBN) Scan(raw interface{}) error

Scan read a value from a database driver

func (ISBN) String Uses

func (u ISBN) String() string

func (*ISBN) UnmarshalBSON Uses

func (u *ISBN) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*ISBN) UnmarshalJSON Uses

func (u *ISBN) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the ISBN from JSON

func (*ISBN) UnmarshalText Uses

func (u *ISBN) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (ISBN) Value Uses

func (u ISBN) Value() (driver.Value, error)

Value converts a value to a database driver value

type ISBN10 Uses

type ISBN10 string

ISBN10 represents an isbn 10 string format

swagger:strfmt isbn10

func (*ISBN10) DeepCopy Uses

func (u *ISBN10) DeepCopy() *ISBN10

DeepCopy copies the receiver into a new ISBN10.

func (*ISBN10) DeepCopyInto Uses

func (u *ISBN10) DeepCopyInto(out *ISBN10)

DeepCopyInto copies the receiver and writes its value into out.

func (ISBN10) MarshalBSON Uses

func (u ISBN10) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (ISBN10) MarshalJSON Uses

func (u ISBN10) MarshalJSON() ([]byte, error)

MarshalJSON returns the ISBN10 as JSON

func (ISBN10) MarshalText Uses

func (u ISBN10) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*ISBN10) Scan Uses

func (u *ISBN10) Scan(raw interface{}) error

Scan read a value from a database driver

func (ISBN10) String Uses

func (u ISBN10) String() string

func (*ISBN10) UnmarshalBSON Uses

func (u *ISBN10) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*ISBN10) UnmarshalJSON Uses

func (u *ISBN10) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the ISBN10 from JSON

func (*ISBN10) UnmarshalText Uses

func (u *ISBN10) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (ISBN10) Value Uses

func (u ISBN10) Value() (driver.Value, error)

Value converts a value to a database driver value

type ISBN13 Uses

type ISBN13 string

ISBN13 represents an isbn 13 string format

swagger:strfmt isbn13

func (*ISBN13) DeepCopy Uses

func (u *ISBN13) DeepCopy() *ISBN13

DeepCopy copies the receiver into a new ISBN13.

func (*ISBN13) DeepCopyInto Uses

func (u *ISBN13) DeepCopyInto(out *ISBN13)

DeepCopyInto copies the receiver and writes its value into out.

func (ISBN13) MarshalBSON Uses

func (u ISBN13) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (ISBN13) MarshalJSON Uses

func (u ISBN13) MarshalJSON() ([]byte, error)

MarshalJSON returns the ISBN13 as JSON

func (ISBN13) MarshalText Uses

func (u ISBN13) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*ISBN13) Scan Uses

func (u *ISBN13) Scan(raw interface{}) error

Scan read a value from a database driver

func (ISBN13) String Uses

func (u ISBN13) String() string

func (*ISBN13) UnmarshalBSON Uses

func (u *ISBN13) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*ISBN13) UnmarshalJSON Uses

func (u *ISBN13) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the ISBN13 from JSON

func (*ISBN13) UnmarshalText Uses

func (u *ISBN13) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (ISBN13) Value Uses

func (u ISBN13) Value() (driver.Value, error)

Value converts a value to a database driver value

type MAC Uses

type MAC string

MAC represents a 48 bit MAC address

swagger:strfmt mac

func (*MAC) DeepCopy Uses

func (u *MAC) DeepCopy() *MAC

DeepCopy copies the receiver into a new MAC.

func (*MAC) DeepCopyInto Uses

func (u *MAC) DeepCopyInto(out *MAC)

DeepCopyInto copies the receiver and writes its value into out.

func (MAC) MarshalBSON Uses

func (u MAC) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (MAC) MarshalJSON Uses

func (u MAC) MarshalJSON() ([]byte, error)

MarshalJSON returns the MAC as JSON

func (MAC) MarshalText Uses

func (u MAC) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*MAC) Scan Uses

func (u *MAC) Scan(raw interface{}) error

Scan read a value from a database driver

func (MAC) String Uses

func (u MAC) String() string

func (*MAC) UnmarshalBSON Uses

func (u *MAC) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*MAC) UnmarshalJSON Uses

func (u *MAC) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the MAC from JSON

func (*MAC) UnmarshalText Uses

func (u *MAC) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (MAC) Value Uses

func (u MAC) Value() (driver.Value, error)

Value converts a value to a database driver value

type NameNormalizer Uses

type NameNormalizer func(string) string

NameNormalizer is a function that normalizes a format name.

type ObjectId Uses

type ObjectId bsonprim.ObjectID

ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID)

swagger:strfmt bsonobjectid

func NewObjectId Uses

func NewObjectId(hex string) ObjectId

NewObjectId creates a ObjectId from a Hex String

func (*ObjectId) DeepCopy Uses

func (id *ObjectId) DeepCopy() *ObjectId

DeepCopy copies the receiver into a new ObjectId.

func (*ObjectId) DeepCopyInto Uses

func (id *ObjectId) DeepCopyInto(out *ObjectId)

DeepCopyInto copies the receiver and writes its value into out.

func (ObjectId) MarshalBSON Uses

func (id ObjectId) MarshalBSON() ([]byte, error)

MarshalBSON renders the object id as a BSON document

func (ObjectId) MarshalBSONValue Uses

func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue is an interface implemented by types that can marshal themselves into a BSON document represented as bytes. The bytes returned must be a valid BSON document if the error is nil.

func (ObjectId) MarshalJSON Uses

func (id ObjectId) MarshalJSON() ([]byte, error)

MarshalJSON returns the ObjectId as JSON

func (ObjectId) MarshalText Uses

func (id ObjectId) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*ObjectId) Scan Uses

func (id *ObjectId) Scan(raw interface{}) error

Scan read a value from a database driver

func (ObjectId) String Uses

func (id ObjectId) String() string

func (*ObjectId) UnmarshalBSON Uses

func (id *ObjectId) UnmarshalBSON(data []byte) error

UnmarshalBSON reads the objectId from a BSON document

func (*ObjectId) UnmarshalBSONValue Uses

func (id *ObjectId) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error

UnmarshalBSONValue is an interface implemented by types that can unmarshal a BSON value representation of themselves. The BSON bytes and type can be assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it wishes to retain the data after returning.

func (*ObjectId) UnmarshalJSON Uses

func (id *ObjectId) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the ObjectId from JSON

func (*ObjectId) UnmarshalText Uses

func (id *ObjectId) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (ObjectId) Value Uses

func (id ObjectId) Value() (driver.Value, error)

Value converts a value to a database driver value

type Password Uses

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) DeepCopy Uses

func (r *Password) DeepCopy() *Password

DeepCopy copies the receiver into a new Password.

func (*Password) DeepCopyInto Uses

func (r *Password) DeepCopyInto(out *Password)

DeepCopyInto copies the receiver and writes its value into out.

func (Password) MarshalBSON Uses

func (r Password) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (Password) MarshalJSON Uses

func (r Password) MarshalJSON() ([]byte, error)

MarshalJSON returns the Password as JSON

func (Password) MarshalText Uses

func (r Password) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*Password) Scan Uses

func (r *Password) Scan(raw interface{}) error

Scan read a value from a database driver

func (Password) String Uses

func (r Password) String() string

func (*Password) UnmarshalBSON Uses

func (r *Password) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*Password) UnmarshalJSON Uses

func (r *Password) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the Password from JSON

func (*Password) UnmarshalText Uses

func (r *Password) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (Password) Value Uses

func (r Password) Value() (driver.Value, error)

Value converts a value to a database driver value

type RGBColor Uses

type RGBColor string

RGBColor represents a RGB color string format

swagger:strfmt rgbcolor

func (*RGBColor) DeepCopy Uses

func (r *RGBColor) DeepCopy() *RGBColor

DeepCopy copies the receiver into a new RGBColor.

func (*RGBColor) DeepCopyInto Uses

func (r *RGBColor) DeepCopyInto(out *RGBColor)

DeepCopyInto copies the receiver and writes its value into out.

func (RGBColor) MarshalBSON Uses

func (r RGBColor) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (RGBColor) MarshalJSON Uses

func (r RGBColor) MarshalJSON() ([]byte, error)

MarshalJSON returns the RGBColor as JSON

func (RGBColor) MarshalText Uses

func (r RGBColor) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*RGBColor) Scan Uses

func (r *RGBColor) Scan(raw interface{}) error

Scan read a value from a database driver

func (RGBColor) String Uses

func (r RGBColor) String() string

func (*RGBColor) UnmarshalBSON Uses

func (r *RGBColor) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*RGBColor) UnmarshalJSON Uses

func (r *RGBColor) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the RGBColor from JSON

func (*RGBColor) UnmarshalText Uses

func (r *RGBColor) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (RGBColor) Value Uses

func (r RGBColor) Value() (driver.Value, error)

Value converts a value to a database driver value

type Registry Uses

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, with a validation method.

func NewFormats Uses

func NewFormats() Registry

NewFormats creates a new formats registry seeded with the values from the default

func NewSeededFormats Uses

func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry

NewSeededFormats creates a new formats registry

type SSN Uses

type SSN string

SSN represents a social security string format

swagger:strfmt ssn

func (*SSN) DeepCopy Uses

func (u *SSN) DeepCopy() *SSN

DeepCopy copies the receiver into a new SSN.

func (*SSN) DeepCopyInto Uses

func (u *SSN) DeepCopyInto(out *SSN)

DeepCopyInto copies the receiver and writes its value into out.

func (SSN) MarshalBSON Uses

func (u SSN) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (SSN) MarshalJSON Uses

func (u SSN) MarshalJSON() ([]byte, error)

MarshalJSON returns the SSN as JSON

func (SSN) MarshalText Uses

func (u SSN) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*SSN) Scan Uses

func (u *SSN) Scan(raw interface{}) error

Scan read a value from a database driver

func (SSN) String Uses

func (u SSN) String() string

func (*SSN) UnmarshalBSON Uses

func (u *SSN) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*SSN) UnmarshalJSON Uses

func (u *SSN) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the SSN from JSON

func (*SSN) UnmarshalText Uses

func (u *SSN) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (SSN) Value Uses

func (u SSN) Value() (driver.Value, error)

Value converts a value to a database driver value

type URI Uses

type URI string

URI represents the uri string format as specified by the json schema spec

swagger:strfmt uri

func (*URI) DeepCopy Uses

func (u *URI) DeepCopy() *URI

DeepCopy copies the receiver into a new URI.

func (*URI) DeepCopyInto Uses

func (u *URI) DeepCopyInto(out *URI)

DeepCopyInto copies the receiver and writes its value into out.

func (URI) MarshalBSON Uses

func (u URI) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (URI) MarshalJSON Uses

func (u URI) MarshalJSON() ([]byte, error)

MarshalJSON returns the URI as JSON

func (URI) MarshalText Uses

func (u URI) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*URI) Scan Uses

func (u *URI) Scan(raw interface{}) error

Scan read a value from a database driver

func (URI) String Uses

func (u URI) String() string

func (*URI) UnmarshalBSON Uses

func (u *URI) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*URI) UnmarshalJSON Uses

func (u *URI) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the URI from JSON

func (*URI) UnmarshalText Uses

func (u *URI) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (URI) Value Uses

func (u URI) Value() (driver.Value, error)

Value converts a value to a database driver value

type UUID Uses

type UUID string

UUID represents a uuid string format

swagger:strfmt uuid

func (*UUID) DeepCopy Uses

func (u *UUID) DeepCopy() *UUID

DeepCopy copies the receiver into a new UUID.

func (*UUID) DeepCopyInto Uses

func (u *UUID) DeepCopyInto(out *UUID)

DeepCopyInto copies the receiver and writes its value into out.

func (UUID) MarshalBSON Uses

func (u UUID) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (UUID) MarshalJSON Uses

func (u UUID) MarshalJSON() ([]byte, error)

MarshalJSON returns the UUID as JSON

func (UUID) MarshalText Uses

func (u UUID) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*UUID) Scan Uses

func (u *UUID) Scan(raw interface{}) error

Scan read a value from a database driver

func (UUID) String Uses

func (u UUID) String() string

func (*UUID) UnmarshalBSON Uses

func (u *UUID) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*UUID) UnmarshalJSON Uses

func (u *UUID) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the UUID from JSON

func (*UUID) UnmarshalText Uses

func (u *UUID) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (UUID) Value Uses

func (u UUID) Value() (driver.Value, error)

Value converts a value to a database driver value

type UUID3 Uses

type UUID3 string

UUID3 represents a uuid3 string format

swagger:strfmt uuid3

func (*UUID3) DeepCopy Uses

func (u *UUID3) DeepCopy() *UUID3

DeepCopy copies the receiver into a new UUID3.

func (*UUID3) DeepCopyInto Uses

func (u *UUID3) DeepCopyInto(out *UUID3)

DeepCopyInto copies the receiver and writes its value into out.

func (UUID3) MarshalBSON Uses

func (u UUID3) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (UUID3) MarshalJSON Uses

func (u UUID3) MarshalJSON() ([]byte, error)

MarshalJSON returns the UUID as JSON

func (UUID3) MarshalText Uses

func (u UUID3) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*UUID3) Scan Uses

func (u *UUID3) Scan(raw interface{}) error

Scan read a value from a database driver

func (UUID3) String Uses

func (u UUID3) String() string

func (*UUID3) UnmarshalBSON Uses

func (u *UUID3) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*UUID3) UnmarshalJSON Uses

func (u *UUID3) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the UUID from JSON

func (*UUID3) UnmarshalText Uses

func (u *UUID3) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (UUID3) Value Uses

func (u UUID3) Value() (driver.Value, error)

Value converts a value to a database driver value

type UUID4 Uses

type UUID4 string

UUID4 represents a uuid4 string format

swagger:strfmt uuid4

func (*UUID4) DeepCopy Uses

func (u *UUID4) DeepCopy() *UUID4

DeepCopy copies the receiver into a new UUID4.

func (*UUID4) DeepCopyInto Uses

func (u *UUID4) DeepCopyInto(out *UUID4)

DeepCopyInto copies the receiver and writes its value into out.

func (UUID4) MarshalBSON Uses

func (u UUID4) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (UUID4) MarshalJSON Uses

func (u UUID4) MarshalJSON() ([]byte, error)

MarshalJSON returns the UUID as JSON

func (UUID4) MarshalText Uses

func (u UUID4) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*UUID4) Scan Uses

func (u *UUID4) Scan(raw interface{}) error

Scan read a value from a database driver

func (UUID4) String Uses

func (u UUID4) String() string

func (*UUID4) UnmarshalBSON Uses

func (u *UUID4) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*UUID4) UnmarshalJSON Uses

func (u *UUID4) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the UUID from JSON

func (*UUID4) UnmarshalText Uses

func (u *UUID4) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (UUID4) Value Uses

func (u UUID4) Value() (driver.Value, error)

Value converts a value to a database driver value

type UUID5 Uses

type UUID5 string

UUID5 represents a uuid5 string format

swagger:strfmt uuid5

func (*UUID5) DeepCopy Uses

func (u *UUID5) DeepCopy() *UUID5

DeepCopy copies the receiver into a new UUID5.

func (*UUID5) DeepCopyInto Uses

func (u *UUID5) DeepCopyInto(out *UUID5)

DeepCopyInto copies the receiver and writes its value into out.

func (UUID5) MarshalBSON Uses

func (u UUID5) MarshalBSON() ([]byte, error)

MarshalBSON document from this value

func (UUID5) MarshalJSON Uses

func (u UUID5) MarshalJSON() ([]byte, error)

MarshalJSON returns the UUID as JSON

func (UUID5) MarshalText Uses

func (u UUID5) MarshalText() ([]byte, error)

MarshalText turns this instance into text

func (*UUID5) Scan Uses

func (u *UUID5) Scan(raw interface{}) error

Scan read a value from a database driver

func (UUID5) String Uses

func (u UUID5) String() string

func (*UUID5) UnmarshalBSON Uses

func (u *UUID5) UnmarshalBSON(data []byte) error

UnmarshalBSON document into this value

func (*UUID5) UnmarshalJSON Uses

func (u *UUID5) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the UUID from JSON

func (*UUID5) UnmarshalText Uses

func (u *UUID5) UnmarshalText(data []byte) error

UnmarshalText hydrates this instance from text

func (UUID5) Value Uses

func (u UUID5) Value() (driver.Value, error)

Value converts a value to a database driver value

type Validator Uses

type Validator func(string) bool

Validator represents a validator for a string format.

Directories

PathSynopsis
conv

Package strfmt imports 20 packages (graph) and is imported by 1921 packages. Updated 2019-10-25. Refresh now. Tools for package owners.