MCPcopy
hub / github.com/marmotedu/iam / Handler

Interface Handler

pkg/storage/storage.go:29–62  ·  view source on GitHub ↗

Handler is a standard interface to a storage backend, used by AuthorisationManager to read and write key values to the backend.

Source from the content-addressed store, hash-verified

27// Handler is a standard interface to a storage backend, used by AuthorisationManager to read and write key values to
28// the backend.
29type Handler interface {
30 GetKey(string) (string, error) // Returned string is expected to be a JSON object (user.SessionState)
31 GetMultiKey([]string) ([]string, error)
32 GetRawKey(string) (string, error)
33 SetKey(string, string, int64) error // Second input string is expected to be a JSON object (user.SessionState)
34 SetRawKey(string, string, int64) error
35 SetExp(string, int64) error // Set key expiration
36 GetExp(string) (int64, error) // Returns expiry of a key
37 GetKeys(string) []string
38 DeleteKey(string) bool
39 DeleteAllKeys() bool
40 DeleteRawKey(string) bool
41 Connect() bool
42 GetKeysAndValues() map[string]string
43 GetKeysAndValuesWithFilter(string) map[string]string
44 DeleteKeys([]string) bool
45 Decrement(string)
46 IncrememntWithExpire(string, int64) int64
47 SetRollingWindow(key string, per int64, val string, pipeline bool) (int, []interface{})
48 GetRollingWindow(key string, per int64, pipeline bool) (int, []interface{})
49 GetSet(string) (map[string]string, error)
50 AddToSet(string, string)
51 GetAndDeleteSet(string) []interface{}
52 RemoveFromSet(string, string)
53 DeleteScanMatch(string) bool
54 GetKeyPrefix() string
55 AddToSortedSet(string, string, float64)
56 GetSortedSetRange(string, string, string) ([]string, []float64, error)
57 RemoveSortedSetRange(string, string, string) error
58 GetListRange(string, int64, int64) ([]string, error)
59 RemoveFromList(string, string) error
60 AppendToSet(string, string)
61 Exists(string) (bool, error)
62}
63
64// AnalyticsHandler defines the interface for analytics.
65type AnalyticsHandler interface {

Callers 3

ExistsMethod · 0.65
RunMethod · 0.95
RunMethod · 0.95

Implementers 1

RedisClusterpkg/storage/redis_cluster.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…