Skip to content

generics support #130

@RelicOfTesla

Description

@RelicOfTesla

like
https://github.com/Code-Hex/go-generics-cache
https://github.com/jellydator/ttlcache
https://github.com/mdaliyan/icache

New a CacheT[V] / CacheKvT[K,V] operator class

type CacheT[V any] interface {
	Has(key string) bool
	Get(key string) (V, bool)
	Set(key string, val V, ttl time.Duration) (err error)
	Del(key string) error
}
type CacheKvT[K comparable, V any] interface {
	Has(key K) bool
	Get(key K) (V, bool)
	Set(key K, val V, ttl time.Duration) (err error)
	Del(key K) error
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions