Documentation ¶
Index ¶
- Constants
- Variables
- func AddEventsChannel(eventsCh chan event.Event) func(o *ExecOpts)
- func DefaultExecOpts(o *ExecOpts)
- func ExecScript(ctx context.Context, target *Target, opts ...func(o *ExecOpts)) (err error)
- func SetLocals(locals map[string]interface{}) func(o *ExecOpts)
- func SetOutputWriter(w io.Writer) func(o *ExecOpts)
- func SetSecrets(secrets map[string]string) func(o *ExecOpts)
- func SetTimeout(duration time.Duration) func(o *ExecOpts)
- func SleepFn(t *starlark.Thread, b *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- type ExecOpts
- type ModuleLoader
- type Runtime
- type Target
- type Type
Constants ¶
View Source
const ( OpsYaml = Type("ops:yaml") OpsStarlark = Type("ops:starlark") )
Variables ¶
View Source
var DefaultModuleLoader = func(thread *starlark.Thread, module string) (dict starlark.StringDict, err error) { return starlib.Loader(thread, module) }
DefaultModuleLoader 默认模块加载
Functions ¶
func AddEventsChannel ¶
AddEventsChannel 设置事件接收器
func ExecScript ¶
ExecScript 执行脚本
func SetSecrets ¶
SetSecrets 设置KEY/VAL对
Types ¶
type ExecOpts ¶
type ExecOpts struct { // 是否启用浮点数 AllowFloat bool // 是否启用集合类型 AllowSet bool // 是否启用lamda表达式 AllowLambda bool // 是否启用闭包 AllowNestedDef bool // allow reassignment to top-level names; also, allow if/for/while at top-level AllowGlobalReassign bool // 密码相关 Secrets map[string]string // 局部变量 Locals map[string]interface{} // output接收 OutputWriter io.Writer // 模块加载方法 ModuleLoader ModuleLoader // 事件转发订阅 EventsCh chan event.Event // 超时 Timeout time.Duration }
ExecOpts 设置运行时相关开关
type ModuleLoader ¶
ModuleLoader 模块加载声明
type Runtime ¶
type Runtime struct { sync.Mutex EventsCh chan event.Event // contains filtered or unexported fields }
Runtime ops解析引擎运行时
Directories ¶
Path | Synopsis |
---|---|
Package event 事件转发基本的生产消费模型
|
Package event 事件转发基本的生产消费模型 |
compress/gzip
Package gzip defines gzip encoding & decoding functions
|
Package gzip defines gzip encoding & decoding functions |
encoding/base64
Package base64 defines base64 encoding & decoding functions
|
Package base64 defines base64 encoding & decoding functions |
encoding/csv
Package csv reads comma-separated values files
|
Package csv reads comma-separated values files |
encoding/json
Package json defines utilities for converting Starlark values to/from JSON strings.
|
Package json defines utilities for converting Starlark values to/from JSON strings. |
encoding/yaml
Package yaml implements a yaml parser for the starlark programming dialect
|
Package yaml implements a yaml parser for the starlark programming dialect |
hash
Package hash defines hash primitives for starlark.
|
Package hash defines hash primitives for starlark. |
html
Package html defines a jquery-like html selection & iteration functions for HTML documents
|
Package html defines a jquery-like html selection & iteration functions for HTML documents |
http
Package http defines a module for doing http operations in starlark
|
Package http defines a module for doing http operations in starlark |
math
Package math is a Starlark module of math-related functions and constants.
|
Package math is a Starlark module of math-related functions and constants. |
re
Package re defines regular expression functions, it's intended to be a drop-in subset of python's re module for starlark: https://docs.python.org/3/library/re.html
|
Package re defines regular expression functions, it's intended to be a drop-in subset of python's re module for starlark: https://docs.python.org/3/library/re.html |
time
Package time provides time-related constants and functions.
|
Package time provides time-related constants and functions. |
zipfile
Package zipfile reads & parses zip archives
|
Package zipfile reads & parses zip archives |
replacecr
Package replacecr defines a wrapper for replacing solo carriage return characters (\r) with carriage-return + line feed (\r\n)
|
Package replacecr defines a wrapper for replacing solo carriage return characters (\r) with carriage-return + line feed (\r\n) |
Click to show internal directories.
Click to hide internal directories.