Documentation ¶
Index ¶
- func CastFloat[T, V constraints.Float](v V) T
- func CastInteger[T, V constraints.Integer](v V) T
- func CastNumber[T, V constraintsi.Number](v V) T
- func CastSigned[T, V constraints.Signed](v V) T
- func CastUnsigned[T, V constraints.Unsigned](v V) T
- func Equal[T constraints.Ordered](a T, b T) bool
- func Greater[T constraints.Ordered](a T, b T) bool
- func Less[T constraints.Ordered](a T, b T) bool
- func TernaryOp[T any](yes bool, a, b T) T
- func Zero[T any]() T
- func Zero2[T any]() T
- type Basic
- type Bool
- func (b Bool) IsFalse() bool
- func (b Bool) IsNone() bool
- func (b Bool) IsTrue() bool
- func (b Bool) MarshalBinary() ([]byte, error)
- func (b Bool) MarshalJSON() ([]byte, error)
- func (b Bool) MarshalText() ([]byte, error)
- func (b Bool) String() string
- func (b *Bool) UnmarshalBinary(data []byte) error
- func (b *Bool) UnmarshalJSON(data []byte) error
- func (b *Bool) UnmarshalText(data []byte) error
- type Dict
- type Enum
- type FCompare
- type FCompareByIndex
- type FGrpcServiceMethod
- type FTask
- type FTaskWithErr
- type Func
- type FuncWithErr
- type GTValue
- type ICompare
- type ICompareKey
- type ID
- type IDelete
- type IDurationGenerator
- type IGet
- type IIdGenerator
- type IInit
- type IKey
- type ISet
- type ISetWithExpire
- type IStore
- type IStoreWithExpire
- type Int
- type LTValue
- type Option
- func (opt *Option[T]) Get() (T, bool)
- func (a *Option[T]) IfNone(action func())
- func (a *Option[T]) IfSome(action func(value T))
- func (opt *Option[T]) IsNone() bool
- func (opt *Option[T]) IsSome() bool
- func (a *Option[T]) MarshalJSON() ([]byte, error)
- func (a *Option[T]) Next() *Option[T]
- func (a *Option[T]) UnmarshalJSON(data []byte) error
- func (opt *Option[T]) Unwrap() T
- func (opt *Option[T]) UnwrapOr(def T) T
- func (opt *Option[T]) UnwrapOrElse(fn func() T) T
- func (opt *Option[T]) Val() (T, bool)
- type Pair
- type Ref
- type Result
- func (a Result[T]) IfErr(action func(err error))
- func (a Result[T]) IfOk(action func(value T))
- func (a Result[T]) IsErr() bool
- func (a Result[T]) IsErrAnd(f func(error) bool) bool
- func (a Result[T]) IsOk() bool
- func (a Result[T]) IsOkAnd(f func(T) bool) bool
- func (a *Result[T]) MarshalJSON() ([]byte, error)
- func (a Result[T]) Or(value T) T
- func (a Result[T]) OrDefault() (v T)
- func (a Result[T]) OrPanic() T
- func (a *Result[T]) UnmarshalJSON(data []byte) error
- func (a Result[T]) Val() (value T, err error)
- type String
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastFloat ¶ added in v1.5.0
func CastFloat[T, V constraints.Float](v V) T
func CastInteger ¶ added in v1.5.0
func CastInteger[T, V constraints.Integer](v V) T
func CastNumber ¶ added in v1.5.0
func CastNumber[T, V constraintsi.Number](v V) T
func CastSigned ¶ added in v1.5.0
func CastSigned[T, V constraints.Signed](v V) T
func CastUnsigned ¶ added in v1.5.0
func CastUnsigned[T, V constraints.Unsigned](v V) T
func Equal ¶ added in v1.5.0
func Equal[T constraints.Ordered](a T, b T) bool
func Greater ¶ added in v1.5.0
func Greater[T constraints.Ordered](a T, b T) bool
func Less ¶ added in v1.5.0
func Less[T constraints.Ordered](a T, b T) bool
Types ¶
type Bool ¶
type Bool int8
func (Bool) MarshalJSON ¶
func (*Bool) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Bool) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Dict ¶
type Dict[K comparable, V any] struct { Key K Value V }
type Enum ¶
type Enum[T constraints.Unsigned | ~string] struct { Value T }
type FCompareByIndex ¶ added in v1.5.0
type FGrpcServiceMethod ¶ added in v1.5.0
type FTaskWithErr ¶ added in v1.5.0
type FuncWithErr ¶
type FuncWithErr func() error
type GTValue ¶
type GTValue[T constraints.Ordered] struct { Value T }
type ICompareKey ¶ added in v1.5.0
type ICompareKey[T comparable] interface { CompareKey() T }
type ID ¶
type ID[T constraintsi.ID] struct { Id T `json:"id"` }
type IDelete ¶
type IDelete[K constraints.Key, V any] interface { Delete(key K) }
type IDurationGenerator ¶
type IGet ¶
type IGet[K constraints.Key, V any] interface { Get(key K) V }
type IIdGenerator ¶
type IIdGenerator[T constraints.ID] interface { Id() T }
type IKey ¶
type IKey[T constraints.Key] interface { Key() T }
type ISet ¶
type ISet[K constraints.Key, V any] interface { Set(key K, v V) }
type ISetWithExpire ¶ added in v1.5.0
type ISetWithExpire[K constraints.Key, V any] interface { SetWithExpire(key K, v V, expire time.Duration) }
type IStoreWithExpire ¶ added in v1.5.0
type IStoreWithExpire[K constraints.Key, V any] interface { ISetWithExpire[K, V] IGet[K, V] IDelete[K, V] }
type LTValue ¶
type LTValue[T constraints.Ordered] struct { Value T }
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func (*Option[T]) MarshalJSON ¶
func (*Option[T]) UnmarshalJSON ¶
func (*Option[T]) UnwrapOrElse ¶
func (opt *Option[T]) UnwrapOrElse(fn func() T) T
type Result ¶
type Result[T any] struct { // contains filtered or unexported fields }
func (*Result[T]) MarshalJSON ¶
func (*Result[T]) UnmarshalJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.