constraints

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatConvert

func FloatConvert[T, V constraints.Float](v V) T

func IntegerConvert

func IntegerConvert[T, V constraints.Integer](v V) T

func NumberConvert

func NumberConvert[T, V Number](v V) T

func SignedConvert

func SignedConvert[T, V constraints.Signed](v V) T

func UnsignedConvert

func UnsignedConvert[T, V constraints.Unsigned](v V) T

Types

type Basic

type Basic struct {
}

type Callback

type Callback[T any] interface {
	~func() | ~func() error | ~func(T) | ~func(T) error
}

type Enum

type Enum[T constraints.Integer] int

type GRPCServiceMethod

type GRPCServiceMethod[REQ, RES any] func(context.Context, REQ) (RES, error)

type ID

type ID interface {
	constraints.Integer | ~string | ~[]byte | ~[8]byte | ~[16]byte
}

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

type Range

type Range interface {
	constraints.Ordered | time.Time | ~*time.Time | ~string
}

type Store

type Store[K, V any] interface {
	Set(k K, v V)
	Get(k K) V
}

type StoreWithExpire

type StoreWithExpire[K, V any] interface {
	Set(k K, v V, expire time.Duration)
	Get(k K) V
}

Jump to

Keyboard shortcuts

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