MCPcopy
hub / github.com/1Panel-dev/KubePi / Get

Method Get

thirdparty/gotty/cache/token/redis.go:27–39  ·  view source on GitHub ↗

Get token param from redis

(token string)

Source from the content-addressed store, hash-verified

25
26//Get token param from redis
27func (r *RedisCache) Get(token string) *TtyParameter {
28 b, err := r.client.Get(context.Background(), r.prefix+token).Bytes()
29 if err != nil {
30 log.Printf("get token %s from redis fatal:%s", token, err.Error())
31 return nil
32 }
33 var param TtyParameter
34 if err := json.Unmarshal(b, &param); err != nil {
35 log.Printf("get token param %s unmarshal err:%s", string(b), err.Error())
36 return nil
37 }
38 return &param
39}
40
41//Delete token from redis
42func (r *RedisCache) Delete(token string) error {

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected