constraints

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

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

type CmpKey

type CmpKey[T comparable] interface {
	CmpKey() T
}

type Compare

type Compare[T any] interface {
	Compare(T) bool
}

type CompareFunc

type CompareFunc[T any] func(T, T) bool

type ID

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

type Number

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

type OrderKey

type OrderKey[T constraints.Ordered] interface {
	OrderKey() T
}

comparable 只能比较是否相等,不能比较大小

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