-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
gredis_redis_group_script.go
30 lines (25 loc) · 1.12 KB
/
gredis_redis_group_script.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package gredis
import (
"context"
"github.com/gogf/gf/v2/container/gvar"
)
// IGroupScript manages redis script operations.
// Implements see redis.GroupScript.
type IGroupScript interface {
Eval(ctx context.Context, script string, numKeys int64, keys []string, args []interface{}) (*gvar.Var, error)
EvalSha(ctx context.Context, sha1 string, numKeys int64, keys []string, args []interface{}) (*gvar.Var, error)
ScriptLoad(ctx context.Context, script string) (string, error)
ScriptExists(ctx context.Context, sha1 string, sha1s ...string) (map[string]bool, error)
ScriptFlush(ctx context.Context, option ...ScriptFlushOption) error
ScriptKill(ctx context.Context) error
}
// ScriptFlushOption provides options for function ScriptFlush.
type ScriptFlushOption struct {
SYNC bool // SYNC flushes the cache synchronously.
ASYNC bool // ASYNC flushes the cache asynchronously.
}