scope

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyFunc

type KeyFunc func(key, scope string) string

scope could be tenant id or user id or other cases, like email/phone Attention: key duplicate

type ScopeBaseStore

type ScopeBaseStore struct {
	// contains filtered or unexported fields
}

why not use general[T] ? because we want to use one store to store diff keys, if use [T], then we just store/handler one key

func New

func New(cache cache.Cache, keyFunc KeyFunc) (*ScopeBaseStore, error)

func NewWithTTL

func NewWithTTL(cache cache.Cache, keyFunc KeyFunc, ttl time.Duration) (*ScopeBaseStore, error)

func (*ScopeBaseStore) CheckGet

func (s *ScopeBaseStore) CheckGet(key, scope string, options ...cache.Option) (string, error)

func (*ScopeBaseStore) CheckGetModel

func (s *ScopeBaseStore) CheckGetModel(key, scope string, value interface{}, options ...cache.Option) error

func (*ScopeBaseStore) CheckGetModelT

func (s *ScopeBaseStore) CheckGetModelT(key, scope string, value interface{}, trace trace.T) error

func (*ScopeBaseStore) CheckGetT

func (s *ScopeBaseStore) CheckGetT(key, scope string, trace trace.T) (string, error)

func (*ScopeBaseStore) Del

func (s *ScopeBaseStore) Del(key, scope string, options ...cache.Option) (int64, error)

func (*ScopeBaseStore) DelT

func (s *ScopeBaseStore) DelT(key, scope string, trace trace.T) (int64, error)

func (*ScopeBaseStore) Exists

func (s *ScopeBaseStore) Exists(key, scope string) (bool, error)

func (*ScopeBaseStore) Get

func (s *ScopeBaseStore) Get(key, scope string, options ...cache.Option) (string, error)

func (*ScopeBaseStore) GetModel

func (s *ScopeBaseStore) GetModel(key, scope string, value interface{}, options ...cache.Option) error

func (*ScopeBaseStore) GetModelT

func (s *ScopeBaseStore) GetModelT(key, scope string, value interface{}, trace trace.T) error

func (*ScopeBaseStore) GetT

func (s *ScopeBaseStore) GetT(key, scope string, trace trace.T) (string, error)

func (*ScopeBaseStore) Set

func (s *ScopeBaseStore) Set(key, scope string, value interface{}, options ...cache.Option) error

func (*ScopeBaseStore) SetModel

func (s *ScopeBaseStore) SetModel(key, scope string, value interface{}, options ...cache.Option) error

func (*ScopeBaseStore) SetModelT

func (s *ScopeBaseStore) SetModelT(key, scope string, value interface{}, trace trace.T) error

func (*ScopeBaseStore) SetT

func (s *ScopeBaseStore) SetT(key, scope string, value interface{}, trace trace.T) error

Jump to

Keyboard shortcuts

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