datatypes

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 14 Imported by: 1

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 added in v0.0.2

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

Types

type Address

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

func MustParseAddress added in v0.0.3

func MustParseAddress(text string) *Address

func NewAddress added in v0.0.3

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 added in v0.0.3

type CanBeZero interface{ Zero() bool }

type DefaultSetter added in v0.0.3

type DefaultSetter interface{ SetDefault() }

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 added in v0.0.2

type ErrUnmarshalExtraNonPointer string

func (ErrUnmarshalExtraNonPointer) Error added in v0.0.2

type ErrUnmarshalExtraNonStruct added in v0.0.2

type ErrUnmarshalExtraNonStruct string

func (ErrUnmarshalExtraNonStruct) Error added in v0.0.2

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 added in v0.0.3

type SecurityStringer interface{ SecurityString() string }

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 added in v0.0.3

type Stringer interface{ String() string }

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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