extended

package
v0.55.28 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const SM2key = "sm2key"
View Source
const SM4key = "sm4key"

Variables

View Source
var ExprContext = make(map[string]interface{})
View Source
var StoreContext string
View Source
var TengoContext = make(map[string]interface{})

Functions

func AdjustMaskEvalArgs added in v0.55.6

func AdjustMaskEvalArgs(fn string, args []string, keypatch map[string]string) (string, []string, bool)

func CounterAdd

func CounterAdd(ns, key, value ast.Value) (output ast.Value, err error)

func CounterDelete

func CounterDelete(ns, key ast.Value) (output ast.Value, err error)

func CounterGet

func CounterGet(ns, key ast.Value) (output ast.Value, err error)

func DeRegisterTengoCustomFunc

func DeRegisterTengoCustomFunc(name string)

func DeRegisterTengoCustomFuncs

func DeRegisterTengoCustomFuncs(names []string)

func DeleteExprCustomFunc

func DeleteExprCustomFunc(name string)

func DeleteExprCustomFuncs

func DeleteExprCustomFuncs(names []string)

func ExprCompiledCall

func ExprCompiledCall(code string, env map[string]interface{}) (interface{}, error)

func ExprNonCompiledEval

func ExprNonCompiledEval(code string, env map[string]interface{}) (interface{}, error)

func GaugeAdd

func GaugeAdd(ns, key, value, duration ast.Value) (output ast.Value, err error)

func GaugeDelete

func GaugeDelete(ns, key ast.Value) (output ast.Value, err error)

func GaugeGet

func GaugeGet(ns, key ast.Value) (output ast.Value, err error)

func JSONShuffle

func JSONShuffle(ns string, model string, input *ast.Term) (*ast.Term, error)

func PatchObject

func PatchObject(keypatch map[string]string, target *ast.Term, et *edittree.EditTree, path string, rule interface{}, tengoEnviroment map[string]tengo.Object, input *ast.Term)

func RegisterExprCustomFunc

func RegisterExprCustomFunc(name string, fn interface{})

func RegisterExprCustomFuncs

func RegisterExprCustomFuncs(fns map[string]interface{})

func RegisterPebbleStore

func RegisterPebbleStore(path string)

func RegisterStoreCustomFunc

func RegisterStoreCustomFunc(path string)

func RegisterTengoCustomFunc

func RegisterTengoCustomFunc(name string, fn interface{})

func RegisterTengoCustomFuncs

func RegisterTengoCustomFuncs(fns map[string]interface{})

func StoreAdd added in v0.55.6

func StoreAdd(ns string, key string, value string)

func StoreDelete added in v0.55.6

func StoreDelete(ns string, key string)

func StoreGet added in v0.55.6

func StoreGet(ns string, key string) string

func TengoEval

func TengoEval(script string, retkey string, env map[string]tengo.Object) (interface{}, error)

func XMLShuffle added in v0.55.15

func XMLShuffle(ns string, model string, input *ast.Term) (*ast.Term, error)

Types

type AA

type AA struct {
	A    string
	Cost int
}

type Counter

type Counter struct {
	Value int64
}

func NewCounter

func NewCounter() Counter

func (*Counter) Add

func (this *Counter) Add(val int64) int64

type Gauge

type Gauge struct {
	Value    int64
	Duration int64

	Timestamp map[int64]int64
	// contains filtered or unexported fields
}

func NewGauge

func NewGauge(duration int64) Gauge

func (*Gauge) Add

func (this *Gauge) Add(val int64)

func (*Gauge) Dec

func (this *Gauge) Dec()

func (*Gauge) GetDuration

func (this *Gauge) GetDuration() int64

func (*Gauge) GetValue

func (this *Gauge) GetValue() int64

func (*Gauge) Inc

func (this *Gauge) Inc()

func (*Gauge) Reset

func (this *Gauge) Reset()

func (*Gauge) SetDuration

func (this *Gauge) SetDuration(duration int64)

type PersistApi

type PersistApi interface {
	Set(key string, value interface{}) error
	SetString(key string, value string) error
	SetInteger(key string, value int64) error
	SetFloat(key string, value float64) error
	SetBool(key string, value bool) error
	SetBytes(key string, value []byte) error
	Get(key string) (interface{}, error)
	GetString(key string) (string, error)
	GetInteger(key string) (int64, error)
	GetBool(key string) (bool, error)
	GetFloat(key string) (float64, error)
	GetBytes(key string) ([]byte, error)
	Delete(key string) error
}

func NewPebbleStorage

func NewPebbleStorage(path string, options pebble.Options) PersistApi

Jump to

Keyboard shortcuts

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