script_helper

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// redis 返回错误值
	RedisErrNoScript = "NOSCRIPT No matching script. Please use EVAL."
)

Variables

View Source
var (
	// 脚本不存在
	ErrScriptNotExist = errors.New("Script Not Exist")
)

Functions

This section is empty.

Types

type ScriptHelper

type ScriptHelper struct {
	*base.Base
}

func NewScriptHelper

func NewScriptHelper(b *base.Base) *ScriptHelper

func (ScriptHelper) Eval

func (s ScriptHelper) Eval(script string, keys []string, args []interface{}) (v *gvar.Var, err error)

func (ScriptHelper) EvalSha

func (s ScriptHelper) EvalSha(sha1 string, keys []string, args []interface{}) (v *gvar.Var, err error)

func (ScriptHelper) ScriptExists

func (s ScriptHelper) ScriptExists(sha1 string, sha1s ...string) (v map[string]bool, err error)

func (ScriptHelper) ScriptFlush

func (s ScriptHelper) ScriptFlush(option ...gredis.ScriptFlushOption) (err error)

func (ScriptHelper) ScriptKill

func (s ScriptHelper) ScriptKill() (err error)

func (ScriptHelper) ScriptLoad

func (s ScriptHelper) ScriptLoad(script string) (v string, err error)

type ScriptRunner added in v1.0.6

type ScriptRunner struct {
	*base.Base
	ScriptHelper *ScriptHelper

	// 脚本列表 name -> ScriptRunnerItem
	Scripts *gmap.Map
}

func NewScriptRunner added in v1.0.6

func NewScriptRunner(b *base.Base) *ScriptRunner

func (*ScriptRunner) AddScript added in v1.0.6

func (s *ScriptRunner) AddScript(name string, script string) (item *ScriptRunnerItem, err error)

func (*ScriptRunner) LoadScript added in v1.0.6

func (s *ScriptRunner) LoadScript(name string) (err error)

func (*ScriptRunner) ReLoadAllScripts added in v1.0.6

func (s *ScriptRunner) ReLoadAllScripts() (err error)

func (*ScriptRunner) ReLoadWithout added in v1.0.6

func (s *ScriptRunner) ReLoadWithout() (err error)

func (*ScriptRunner) RunAutoLoadScript added in v1.0.9

func (s *ScriptRunner) RunAutoLoadScript(name, script string, keys []string, args []interface{}) (v *gvar.Var, err error)

func (*ScriptRunner) RunScript added in v1.0.6

func (s *ScriptRunner) RunScript(name string, keys []string, args []interface{}) (v *gvar.Var, err error)

func (*ScriptRunner) SearchScript added in v1.0.7

func (s *ScriptRunner) SearchScript(name string) (item *ScriptRunnerItem, ok bool)

func (*ScriptRunner) SetScript added in v1.0.6

func (s *ScriptRunner) SetScript(name string, script string) (err error)

type ScriptRunnerItem added in v1.0.6

type ScriptRunnerItem struct {
	Script string
	Sha1   string
}

func NewScriptRunnerItem added in v1.0.6

func NewScriptRunnerItem(script, sha1 string) *ScriptRunnerItem

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL