preformTypes

package
v0.0.0-...-1e4cd2d Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ZeroRat = NewRat(0, 1)
)

Functions

func GenericScan

func GenericScan(v, src any) error

Types

type Array

type Array[T any] []T

func (Array[T]) IterAny

func (a Array[T]) IterAny() []any

func (*Array[T]) Scan

func (a *Array[T]) Scan(src any) error

func (Array[T]) TypeForExport

func (a Array[T]) TypeForExport() any

func (*Array[T]) UnwrapPtr

func (a *Array[T]) UnwrapPtr() any

func (Array[T]) Value

func (a Array[T]) Value() (driver.Value, error)

func (Array[T]) ValueParsers

func (a Array[T]) ValueParsers(v Array[T]) any

type JsonRaw

type JsonRaw[T any] struct {
	// contains filtered or unexported fields
}

func NewJsonRaw

func NewJsonRaw[T any](v T) JsonRaw[T]

func (*JsonRaw[T]) Get

func (j *JsonRaw[T]) Get() T

func (JsonRaw[T]) MarshalJSON

func (j JsonRaw[T]) MarshalJSON() ([]byte, error)

func (*JsonRaw[T]) Scan

func (j *JsonRaw[T]) Scan(src interface{}) (err error)

func (*JsonRaw[T]) Set

func (j *JsonRaw[T]) Set(v T)

func (*JsonRaw[T]) SetSrc

func (j *JsonRaw[T]) SetSrc(src []byte)

func (JsonRaw[T]) Src

func (j JsonRaw[T]) Src() []byte

func (JsonRaw[T]) String

func (j JsonRaw[T]) String() string

func (JsonRaw[T]) T

func (j JsonRaw[T]) T() any

func (JsonRaw[T]) TypeForExport

func (j JsonRaw[T]) TypeForExport() any

func (*JsonRaw[T]) UnmarshalJSON

func (j *JsonRaw[T]) UnmarshalJSON(src []byte) error

func (*JsonRaw[T]) V

func (j *JsonRaw[T]) V() (driver.Value, error)

func (JsonRaw[T]) Value

func (j JsonRaw[T]) Value() (driver.Value, error)

type Null

type Null[T any] struct {
	Valid bool
	V     T
}

func NewNull

func NewNull[T any](v T) Null[T]

func (Null[T]) MarshalJSON

func (j Null[T]) MarshalJSON() ([]byte, error)

func (*Null[T]) Scan

func (n *Null[T]) Scan(src any) error

func (Null[T]) T

func (j Null[T]) T() any

func (Null[T]) TypeForExport

func (j Null[T]) TypeForExport() any

func (*Null[T]) UnmarshalJSON

func (j *Null[T]) UnmarshalJSON(src []byte) error

func (*Null[T]) UnwrapPtr

func (j *Null[T]) UnwrapPtr() any

func (Null[T]) Value

func (n Null[T]) Value() (driver.Value, error)

type Rat

type Rat struct {
	big.Rat
}

func NewRat

func NewRat(a, b int64) *Rat

func NewRatFromFloat64

func NewRatFromFloat64(f float64) *Rat

func NewRatFromString

func NewRatFromString(s string) *Rat

func (*Rat) Abs

func (z *Rat) Abs(x *Rat) *Rat

Abs sets z to |x| (the absolute value of x) and returns z.

func (*Rat) Add

func (z *Rat) Add(x, y *Rat) *Rat

Add sets z to the sum x+y and returns z.

func (*Rat) AddX

func (z *Rat) AddX(x *Rat) *Rat

func (*Rat) Clone

func (z *Rat) Clone() *Rat

func (*Rat) Cmp

func (x *Rat) Cmp(y *Rat) int

Cmp compares x and y and returns:

-1 if x <  y
 0 if x == y
+1 if x >  y

func (*Rat) FloatString

func (z *Rat) FloatString(prec int) string

func (*Rat) Inv

func (z *Rat) Inv(x *Rat) *Rat

Inv sets z to 1/x and returns z. If x == 0, Inv panics.

func (Rat) MarshalJSON

func (j Rat) MarshalJSON() ([]byte, error)

func (*Rat) Mul

func (z *Rat) Mul(x, y *Rat) *Rat

Mul sets z to the product x*y and returns z.

func (*Rat) MulX

func (z *Rat) MulX(x *Rat) *Rat

func (*Rat) Neg

func (z *Rat) Neg() *Rat

Neg sets z to -z and returns z.

func (*Rat) Quo

func (z *Rat) Quo(x, y *Rat) *Rat

Quo sets z to the quotient x/y and returns z. If y == 0, Quo panics.

func (*Rat) QuoX

func (z *Rat) QuoX(x *Rat) *Rat

func (*Rat) Scan

func (z *Rat) Scan(value interface{}) error

func (*Rat) Set

func (z *Rat) Set(x *Rat) *Rat

Set sets z to x (by making a copy of x) and returns z.

func (*Rat) SetFloat64

func (z *Rat) SetFloat64(f float64) *Rat

SetFloat64 sets z to exactly f and returns z. If f is not finite, SetFloat returns nil.

func (*Rat) SetFrac

func (z *Rat) SetFrac(a, b *big.Int) *Rat

SetFrac sets z to a/b and returns z. If b == 0, SetFrac panics.

func (*Rat) SetFrac64

func (z *Rat) SetFrac64(a, b int64) *Rat

SetFrac64 sets z to a/b and returns z. If b == 0, SetFrac64 panics.

func (*Rat) SetInt

func (z *Rat) SetInt(x *big.Int) *Rat

SetInt sets z to x (by making a copy of x) and returns z.

func (*Rat) SetInt64

func (z *Rat) SetInt64(x int64) *Rat

SetInt64 sets z to x and returns z.

func (*Rat) SetString

func (z *Rat) SetString(s string) (*Rat, bool)

SetString sets z to the value of s and returns z and a boolean indicating success.

func (*Rat) SetUint64

func (z *Rat) SetUint64(x uint64) *Rat

SetUint64 sets z to x and returns z.

func (*Rat) String

func (z *Rat) String() string

func (*Rat) Sub

func (z *Rat) Sub(x, y *Rat) *Rat

Sub sets z to the difference x-y and returns z.

func (*Rat) SubX

func (z *Rat) SubX(x *Rat) *Rat

func (Rat) TypeForExport

func (j Rat) TypeForExport() any

swagger as string

func (*Rat) UnmarshalJSON

func (j *Rat) UnmarshalJSON(src []byte) error

func (Rat) Value

func (z Rat) Value() (driver.Value, error)

type SqliteTime

type SqliteTime time.Time

func (*SqliteTime) Scan

func (t *SqliteTime) Scan(src any) error

func (SqliteTime) Value

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

Jump to

Keyboard shortcuts

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