github.com/gogf/gf/v2@v2.7.4/database/gredis/gredis_redis_group_script.go (about)

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