formats

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValueTrimSpace = errors.New("value should not start or end with whitespace")

Functions

This section is empty.

Types

type Binary

type Binary struct {
	Default bool
}

func (Binary) StringValue

func (b Binary) StringValue(input interface{}) (string, bool)

func (Binary) Type

func (b Binary) Type() (reflect.Type, bool)

func (Binary) ValidateValue

func (b Binary) ValidateValue(input string) (interface{}, error)

type Date

type Date struct{}

func (Date) StringValue

func (d Date) StringValue(input interface{}) (string, bool)

func (Date) Type

func (d Date) Type() (reflect.Type, bool)

func (Date) ValidateValue

func (d Date) ValidateValue(input string) (interface{}, error)

type DateTime

type DateTime struct{}

func (DateTime) StringValue

func (d DateTime) StringValue(input interface{}) (string, bool)

func (DateTime) Type

func (d DateTime) Type() (reflect.Type, bool)

func (DateTime) ValidateValue

func (d DateTime) ValidateValue(input string) (interface{}, error)

type DurationGo

type DurationGo struct{}

func (DurationGo) StringValue

func (d DurationGo) StringValue(input interface{}) (string, bool)

func (DurationGo) Type

func (d DurationGo) Type() (reflect.Type, bool)

func (DurationGo) ValidateValue

func (d DurationGo) ValidateValue(input string) (interface{}, error)

type DurationRFC3339

type DurationRFC3339 struct{}

func (DurationRFC3339) StringValue

func (d DurationRFC3339) StringValue(input interface{}) (string, bool)

func (DurationRFC3339) Type

func (d DurationRFC3339) Type() (reflect.Type, bool)

func (DurationRFC3339) ValidateValue

func (d DurationRFC3339) ValidateValue(input string) (interface{}, error)

type Email

type Email struct {
	Default bool
}

func (Email) StringValue

func (e Email) StringValue(input interface{}) (string, bool)

func (Email) Type

func (e Email) Type() (reflect.Type, bool)

func (Email) ValidateValue

func (e Email) ValidateValue(input string) (interface{}, error)

type Hostname

type Hostname struct{}

func (Hostname) StringValue

func (h Hostname) StringValue(input interface{}) (string, bool)

func (Hostname) Type

func (h Hostname) Type() (reflect.Type, bool)

func (Hostname) ValidateValue

func (h Hostname) ValidateValue(input string) (interface{}, error)

type IP

type IP struct {
	AllowIPv4 bool
	AllowIPv6 bool
	Default   bool
}

func (IP) StringValue

func (i IP) StringValue(input interface{}) (string, bool)

func (IP) Type

func (i IP) Type() (reflect.Type, bool)

func (IP) ValidateValue

func (i IP) ValidateValue(input string) (interface{}, error)

type IPCIDR

type IPCIDR struct {
	AllowIPv4 bool
	AllowIPv6 bool
	Default   bool
}

func (IPCIDR) StringValue

func (i IPCIDR) StringValue(input interface{}) (string, bool)

func (IPCIDR) Type

func (i IPCIDR) Type() (reflect.Type, bool)

func (IPCIDR) ValidateValue

func (i IPCIDR) ValidateValue(input string) (interface{}, error)

type Regex

type Regex struct{}

func (Regex) StringValue

func (r Regex) StringValue(input interface{}) (string, bool)

func (Regex) Type

func (r Regex) Type() (reflect.Type, bool)

func (Regex) ValidateValue

func (r Regex) ValidateValue(input string) (interface{}, error)

type String

type String struct{}

func (String) StringValue

func (s String) StringValue(input interface{}) (string, bool)

func (String) Type

func (s String) Type() (reflect.Type, bool)

func (String) ValidateValue

func (s String) ValidateValue(input string) (interface{}, error)

type Time

type Time struct{}

func (Time) StringValue

func (t Time) StringValue(input interface{}) (string, bool)

func (Time) Type

func (t Time) Type() (reflect.Type, bool)

func (Time) ValidateValue

func (t Time) ValidateValue(input string) (interface{}, error)

type URI

type URI struct {
	Default       bool
	RequireScheme bool
}

func (URI) StringValue

func (u URI) StringValue(input interface{}) (string, bool)

func (URI) Type

func (u URI) Type() (reflect.Type, bool)

func (URI) ValidateValue

func (u URI) ValidateValue(input string) (interface{}, error)

type UUID

type UUID struct{}

func (UUID) StringValue

func (u UUID) StringValue(input interface{}) (string, bool)

func (UUID) Type

func (u UUID) Type() (reflect.Type, bool)

func (UUID) ValidateValue

func (u UUID) ValidateValue(input string) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL