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

Method SetKey

pkg/storage/redis_cluster.go:523–538  ·  view source on GitHub ↗

SetKey will create (or update) a key value in the store.

(keyName, session string, timeout time.Duration)

Source from the content-addressed store, hash-verified

521
522// SetKey will create (or update) a key value in the store.
523func (r *RedisCluster) SetKey(keyName, session string, timeout time.Duration) error {
524 log.Debugf("[STORE] SET Raw key is: %s", keyName)
525 log.Debugf("[STORE] Setting key: %s", r.fixKey(keyName))
526
527 if err := r.up(); err != nil {
528 return err
529 }
530 err := r.singleton().Set(r.fixKey(keyName), session, timeout).Err()
531 if err != nil {
532 log.Errorf("Error trying to set value: %s", err.Error())
533
534 return err
535 }
536
537 return nil
538}
539
540// SetRawKey set the value of the given key.
541func (r *RedisCluster) SetRawKey(keyName, session string, timeout time.Duration) error {

Callers

nothing calls this directly

Calls 7

fixKeyMethod · 0.95
upMethod · 0.95
singletonMethod · 0.95
DebugfFunction · 0.92
ErrorfFunction · 0.92
SetMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected