Documentation
¶
Overview ¶
dns, plugin, and driver are all derivatives of the dependency analysis pattern. They are now abandoned, see pack/dependency.go for details.
dns, plugin, and driver are all derivatives of the dependency analysis pattern. They are now abandoned, see pack/dependency.go for details.
dns, plugin, and driver are all derivatives of the dependency analysis pattern. They are now abandoned, see pack/dependency.go for details.
Index ¶
- func NewYockLoader(s yocki.YockState) *yockLoader
- type ChannelPool
- type Context
- type CooperationSingalStream
- type DNS
- func (dns *DNS) AliasDriver(domain, alias string) error
- func (dns *DNS) AliasPlugin(domain, alias string) error
- func (dns *DNS) GetDriver(domain string) asset
- func (dns *DNS) GetPlugin(domain string) asset
- func (dns *DNS) PutDriver(domain, url, path string) error
- func (dns *DNS) PutPlugin(domain, url, path string) error
- func (dns *DNS) UnputDriver(domain string)
- func (dns *DNS) UnputPlugin(domain string)
- func (dns *DNS) UpdateDriver(domain, url, path string)
- func (dns *DNS) UpdatePlugin(domain, url, path string)
- type PriorityPool
- type RandomPool
- type SingleSignalStream
- type YGFunction
- type YockModeManager
- type YockScheduler
- func (yocks *YockScheduler) AppendTask(name string, job yocki.YockJob)
- func (loader YockScheduler) CreateLib(name string) yocki.YockLib
- func (yocks *YockScheduler) Do(f func())
- func (yocks *YockScheduler) Env() yocki.YockLib
- func (yocks *YockScheduler) EnvVar() yocki.EnvVar
- func (yocks *YockScheduler) EventLoop()
- func (db YockScheduler) Get(k string) lua.LValue
- func (yocks *YockScheduler) GetTask(name string) bool
- func (yocks *YockScheduler) LaunchTask(name string)
- func (yocks *YockScheduler) LoadLibs()
- func (yocks *YockScheduler) LoadLibsV1()
- func (yocks *YockScheduler) LoadYockd()
- func (yocks *YockScheduler) LoadYocki()
- func (yocks *YockScheduler) MntYocksFn(lib yocki.YockLib, funcs yocki.YocksFuncs)
- func (loader YockScheduler) OpenLib(name string) yocki.YockLib
- func (yocks *YockScheduler) Opt() yocki.Table
- func (db YockScheduler) Put(k string, v lua.LValue)
- func (loader YockScheduler) RegLuaFn(v yocki.LuaFuncs)
- func (loader YockScheduler) RegYockFn(v yocki.YockFuns)
- func (yocks *YockScheduler) RegYocksFn(funcs yocki.YocksFuncs)
- func (yocks *YockScheduler) SetOpt(o yocki.Table)
- func (yocks *YockScheduler) Signal() yocki.SignalStream
- func (yocks *YockScheduler) State() yocki.YockState
- type YockSchedulerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewYockLoader ¶
Types ¶
type ChannelPool ¶
type ChannelPool struct {
// contains filtered or unexported fields
}
func (*ChannelPool) Go ¶
func (pool *ChannelPool) Go(f func())
func (*ChannelPool) Run ¶
func (pool *ChannelPool) Run()
type CooperationSingalStream ¶
type CooperationSingalStream struct { *SingleSignalStream // contains filtered or unexported fields }
CooperationSingalStream is a distributed implementation of SignalStream, using grpc + protobuf to transmit signals.
func NewCooperationSingalStream ¶
func NewCooperationSingalStream(c *net.DirectClient) *CooperationSingalStream
func (*CooperationSingalStream) Load ¶
func (stream *CooperationSingalStream) Load(sig string) (any, bool)
Load returns the value of the specified singal. If the singal isn't exist, the second parameter returns false, and vice versa. In CooperationSingalStream, each load will send a request to daemon to ask for the signal status, and set the value if it exists.
func (*CooperationSingalStream) Store ¶
func (stream *CooperationSingalStream) Store(sig string, v bool)
Store settings specify the value of the singal, similar to map's kv storage and send it to daemon.
type DNS ¶
type DNS struct { Driver map[string]asset `json:"driver"` Plugin map[string]asset `json:"plugin"` Version string `json:"version"` // contains filtered or unexported fields }
func (*DNS) AliasDriver ¶
func (*DNS) AliasPlugin ¶
func (*DNS) UnputDriver ¶
func (*DNS) UnputPlugin ¶
func (*DNS) UpdateDriver ¶
func (*DNS) UpdatePlugin ¶
type PriorityPool ¶
type PriorityPool struct {
// contains filtered or unexported fields
}
func (*PriorityPool) Go ¶
func (pool *PriorityPool) Go(f func())
type RandomPool ¶
type RandomPool struct{}
type SingleSignalStream ¶
type SingleSignalStream struct {
// contains filtered or unexported fields
}
SingleSignalStream is a single-process implementation of SignalStream, where signals only flow in the process.
func NewSingleSignalStream ¶
func NewSingleSignalStream() *SingleSignalStream
func (*SingleSignalStream) Load ¶
func (stream *SingleSignalStream) Load(sig string) (any, bool)
Load returns the value of the specified singal. If the singal isn't exist, the second parameter returns false, and vice versa.
func (*SingleSignalStream) Store ¶
func (stream *SingleSignalStream) Store(sig string, v bool)
Store settings specify the value of the singal, similar to map's kv storage.
type YGFunction ¶
type YGFunction func(*YockScheduler, *yockr.YockState) int
type YockModeManager ¶
type YockModeManager int32
func (*YockModeManager) Debug ¶
func (ym *YockModeManager) Debug() bool
func (*YockModeManager) Mode ¶
func (ym *YockModeManager) Mode() int32
func (*YockModeManager) SetMode ¶
func (ym *YockModeManager) SetMode(m int32)
func (*YockModeManager) Strict ¶
func (ym *YockModeManager) Strict() bool
func (*YockModeManager) UnsetMode ¶
func (ym *YockModeManager) UnsetMode(m int32)
type YockScheduler ¶
type YockScheduler struct { // Interpreter for yock scripts. // // Note that concurrency is not safe, // so each different task or asynchronous function will call the thread method // to derive a new interpreter and isolate execution. yocki.YockRuntime // contains filtered or unexported fields }
YockScheduler runs and schedules yock scripts in task units.
func Default ¶
func Default(opts ...YockSchedulerOption) *YockScheduler
func New ¶
func New(opts ...YockSchedulerOption) *YockScheduler
func (*YockScheduler) AppendTask ¶
func (yocks *YockScheduler) AppendTask(name string, job yocki.YockJob)
func (*YockScheduler) Do ¶
func (yocks *YockScheduler) Do(f func())
func (*YockScheduler) Env ¶
func (yocks *YockScheduler) Env() yocki.YockLib
func (*YockScheduler) EnvVar ¶
func (yocks *YockScheduler) EnvVar() yocki.EnvVar
func (*YockScheduler) EventLoop ¶
func (yocks *YockScheduler) EventLoop()
EventLoop periodically takes fn from goroutines and assigns goroutine execution
In a future version, event loop will be based on the AST syntax tree or not
func (*YockScheduler) GetTask ¶
func (yocks *YockScheduler) GetTask(name string) bool
func (*YockScheduler) LaunchTask ¶
func (yocks *YockScheduler) LaunchTask(name string)
LaunchTask executes the corresponding task based on the task name
func (*YockScheduler) LoadLibs ¶
func (yocks *YockScheduler) LoadLibs()
LoadLibs loads the libraries that go provides to Lua
func (*YockScheduler) LoadYockd ¶
func (yocks *YockScheduler) LoadYockd()
func (*YockScheduler) LoadYocki ¶
func (yocks *YockScheduler) LoadYocki()
func (*YockScheduler) MntYocksFn ¶
func (yocks *YockScheduler) MntYocksFn(lib yocki.YockLib, funcs yocki.YocksFuncs)
func (*YockScheduler) Opt ¶
func (yocks *YockScheduler) Opt() yocki.Table
func (*YockScheduler) RegYocksFn ¶
func (yocks *YockScheduler) RegYocksFn(funcs yocki.YocksFuncs)
func (*YockScheduler) SetOpt ¶
func (yocks *YockScheduler) SetOpt(o yocki.Table)
func (*YockScheduler) Signal ¶
func (yocks *YockScheduler) Signal() yocki.SignalStream
func (*YockScheduler) State ¶
func (yocks *YockScheduler) State() yocki.YockState
type YockSchedulerOption ¶
type YockSchedulerOption func(*YockScheduler) error
func OptionEnableEnvVar ¶
func OptionEnableEnvVar() YockSchedulerOption
OptionEnableEnvVar can CRUD environment variable. In some systems, you need administrator privileges to start
func OptionLibPath ¶
func OptionLibPath(path string) YockSchedulerOption
func OptionUpgradeSingalStream ¶
func OptionUpgradeSingalStream() YockSchedulerOption
OptionUpgradeSingalStream upgrades SingleSignalStream to CooperationSingalStream to meet distributed needs.