svc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject[T any](p do.Provider[T])

func Use

func Use[T any]() T

Types

type CacheSvc

type CacheSvc struct {
	Local *cache.Cache
	Redis *redis.Client
}

func NewCacheSvc

func NewCacheSvc(i *do.Injector) (*CacheSvc, error)

func (*CacheSvc) ListCaches

func (s *CacheSvc) ListCaches(typ string, keywords ...string) ([]mdl.Cache, int64, error)

func (*CacheSvc) RemoveCaches

func (s *CacheSvc) RemoveCaches(typ string, keys ...string) error

type DataSvc

type DataSvc[M any] struct {
	*Svc[M]
	*dao.Dao[M]
}

func NewDataSvc

func NewDataSvc[M any](prefix string) *DataSvc[M]

func (*DataSvc[M]) GetLocal

func (s *DataSvc[M]) GetLocal(expiration time.Duration, conds ...any) (*M, error)

func (*DataSvc[M]) GetRedis

func (s *DataSvc[M]) GetRedis(expiration time.Duration, conds ...any) (*M, error)

func (*DataSvc[M]) ListLocal

func (s *DataSvc[M]) ListLocal(expiration time.Duration, conds ...any) ([]M, error)

func (*DataSvc[M]) ListRedis

func (s *DataSvc[M]) ListRedis(expiration time.Duration, conds ...any) ([]M, error)

type Svc

type Svc[M any] struct {
	*CacheSvc
	// contains filtered or unexported fields
}

func NewSvc

func NewSvc[M any](prefix string) *Svc[M]

func (*Svc[M]) GetFullKey

func (s *Svc[M]) GetFullKey(keys ...any) string

Jump to

Keyboard shortcuts

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