datatypex

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 16 Imported by: 2

README

datatypes

codecov Go Report Card Go Reference

Documentation

Index

Constants

View Source
const AddressSchemeName = "asset"
View Source
const (
	// DefaultTimestampLayout default timestamp layout
	DefaultTimestampLayout = "2006-01-02T15:04:05.000Z07:00"
)
View Source
const MaskedPassword = "--------"

Variables

View Source
var (
	UTC               = time.UTC
	CST               = time.FixedZone("CST", 8*60*60)
	TimestampZero     = Timestamp{time.Time{}}
	TimestampUnixZero = Timestamp{time.Unix(0, 0)}
)
View Source
var (
	RtTextUnmarshaller = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
	RtTextMarshaller   = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
)

Reflects

Functions

func UnmarshalExtra

func UnmarshalExtra(ext url.Values, v any) error

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

func NewAddress

func NewAddress(group, filename string) *Address

func ParseAddress

func ParseAddress(text string) (*Address, error)

func (Address) DataType

func (a Address) DataType(string) string

func (Address) MarshalText

func (a Address) MarshalText() ([]byte, error)

func (*Address) Scan

func (a *Address) Scan(src any) error

func (Address) String

func (a Address) String() string

func (*Address) UnmarshalText

func (a *Address) UnmarshalText(text []byte) error

func (Address) Value

func (a Address) Value() (driver.Value, error)

type Binary

type Binary []byte

func (Binary) MarshalText

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

func (*Binary) UnmarshalText

func (d *Binary) UnmarshalText(data []byte) (err error)

type CanBeZero

type CanBeZero interface{ Zero() bool }

Interfaces

type DefaultSetter

type DefaultSetter interface{ SetDefault() }

Interfaces

type Endpoint

type Endpoint struct {
	Scheme   string
	Host     string
	Port     uint16
	Base     string
	Path     string
	Username string
	Password Password
	Param    url.Values
}

func ParseEndpoint

func ParseEndpoint(text string) (*Endpoint, error)

func (Endpoint) Hostname

func (e Endpoint) Hostname() string

func (Endpoint) IsZero

func (e Endpoint) IsZero() bool

func (Endpoint) MarshalText

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

func (Endpoint) SecurityString

func (e Endpoint) SecurityString() string

func (Endpoint) String

func (e Endpoint) String() string

func (*Endpoint) UnmarshalText

func (e *Endpoint) UnmarshalText(text []byte) error

type ErrUnmarshalExtraNonPointer

type ErrUnmarshalExtraNonPointer string

func (ErrUnmarshalExtraNonPointer) Error

type ErrUnmarshalExtraNonStruct

type ErrUnmarshalExtraNonStruct string

func (ErrUnmarshalExtraNonStruct) Error

type JSONValue added in v0.0.8

type JSONValue interface {
	json.Unmarshaler
	json.Marshaler
}

type Password

type Password string

func (Password) SecurityString

func (p Password) SecurityString() string

func (Password) String

func (p Password) String() string

type SFID

type SFID uint64

func (SFID) MarshalText

func (sf SFID) MarshalText() ([]byte, error)

func (SFID) String

func (sf SFID) String() string

func (*SFID) UnmarshalText

func (sf *SFID) UnmarshalText(data []byte) (err error)

type SFIDs

type SFIDs []SFID

func (SFIDs) ToUint64

func (sfs SFIDs) ToUint64() (integers []uint64)

type SecurityStringer

type SecurityStringer interface{ SecurityString() string }

Interfaces

type SqlValue

type SqlValue interface {
	driver.Value
	sql.Scanner
	DataType(engine string) string
}

SqlValue can convert between sql value and describe sql datatype

type Stringer

type Stringer interface{ String() string }

Interfaces

type TextValue added in v0.0.8

type TextValue interface {
	encoding.TextUnmarshaler
	encoding.TextMarshaler
}

type Timestamp

type Timestamp struct{ time.Time }

openapi:strfmt date-time

func Now

func Now() Timestamp

func ParseTimestampFromString

func ParseTimestampFromString(s string) (Timestamp, error)

func ParseTimestampFromStringWithLayout

func ParseTimestampFromStringWithLayout(input, layout string) (Timestamp, error)

func (Timestamp) DataType

func (Timestamp) DataType(_ string) string

func (*Timestamp) Equal

func (t *Timestamp) Equal(compared Timestamp) bool

func (*Timestamp) EqualMicroSeconds

func (t *Timestamp) EqualMicroSeconds(compared Timestamp) bool

func (*Timestamp) EqualMillionSeconds

func (t *Timestamp) EqualMillionSeconds(compared Timestamp) bool

func (*Timestamp) EqualSeconds

func (t *Timestamp) EqualSeconds(compared Timestamp) bool

func (Timestamp) IsZero

func (t Timestamp) IsZero() bool

func (Timestamp) MarshalText

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

func (*Timestamp) Scan

func (t *Timestamp) Scan(value any) error

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalText

func (t *Timestamp) UnmarshalText(data []byte) error

func (Timestamp) Value

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

type UUID added in v0.0.8

type UUID struct {
	uuid.UUID
}

func NewUUID added in v0.0.8

func NewUUID() (UUID, error)

func (UUID) DataType added in v0.0.8

func (UUID) DataType(driver string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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