sys

package
v0.0.0-...-71fdcac Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPlugin

func LoadPlugin(ctx context.Context, plugin, symbol, name string) (apiplugin.ParigotInit, error)

func LoadPluginAndAddHostFunc

func LoadPluginAndAddHostFunc(ctx context.Context, pluginPath string, pluginSymbol string, searchDir []string, engine eng.Engine, hid id.HostId, name string) error

Types

type DeployContext

type DeployContext struct {
	// contains filtered or unexported fields
}

A DeployContext represents a deployment during the process of starting it up. A context holds the processes that are used by other parts of the system.

func NewDeployContext

func NewDeployContext(conf *runner.DeployConfig) (*DeployContext, error)

NewDeployContext returns a new, initialized DeployContext object or an error. This function can be thought of as the bridge between the configuration of the deploy (runner.DeployConfig) and the running state of the deployment which is represented by DeployContext. This context can be used to create processes and start them running.

func (*DeployContext) CreateAllProcess

func (c *DeployContext) CreateAllProcess() error

CreateAllProcess returns an error if it could not create a process (and an underlying store) for each module that was configured. CreateAllProcess does not start the processes running, see Start() for that.

func (*DeployContext) LoadAllModules

func (c *DeployContext) LoadAllModules(e eng.Engine) error

func (*DeployContext) NotifyMap

func (d *DeployContext) NotifyMap() *sync.Map

func (*DeployContext) Process

func (c *DeployContext) Process() *sync.Map

func (*DeployContext) SearchDir

func (c *DeployContext) SearchDir() []string

func (*DeployContext) StartMain

func (c *DeployContext) StartMain(mainProg string) (int, error)

StartMain runs a main program (one that is not a server and usually expected to terminate) and returns the error code provided by the main program. Note that this function is run synchronously, not on a goroutine.

func (*DeployContext) StartServer

func (c *DeployContext) StartServer(ctx context.Context) ([]string, int)

StartServer takes all the processes that were created with CreateAllProcess and are marked as servers and starts them. It also returns a list of names that are the names of the "main" program(s). Main process can be proper main programs (run to completion programs) or tests, depending on the value of the flags in the configuration. If there was an error, this function returns a nil for the list of main programs and it returns the exit code to be used when exiting.

func (*DeployContext) Timezone

func (c *DeployContext) Timezone() string

type ParigotExitCode

type ParigotExitCode uint8
const (
	ExitCodeArgsTooLarge  ParigotExitCode = 252
	ExitCodeNoStartSymbol ParigotExitCode = 251
	ExitCodePanic         ParigotExitCode = 254
	ExitCodeTrapped       ParigotExitCode = 253
	ExitCodeNoMain        ParigotExitCode = 255
)

type Process

type Process struct {
	// contains filtered or unexported fields
}

func NewProcessFromMicroservice

func NewProcessFromMicroservice(engine eng.Engine, m Service, ctx *DeployContext, hid id.HostId) (*Process, error)

NewProcessFromMicroservice does not handle concurrent use. It assumes that each call to this method is called from the same thread/goroutine, in sequence. This is, effectively, a loader for the os. xxxfixme this really should be safe to use in multiple go routines ... then we could have a repl??

func (*Process) Exit

func (p *Process) Exit()

func (*Process) ExitCode

func (p *Process) ExitCode() int

func (*Process) Exited

func (p *Process) Exited() bool

func (*Process) IsRunning

func (p *Process) IsRunning() bool

func (*Process) IsServer

func (p *Process) IsServer() bool

func (*Process) Run

func (p *Process) Run()

Run() is used to let a process proceed with running. This is called when we discover all his requirements have been met.

func (*Process) Running

func (p *Process) Running() bool

func (*Process) SetExitCode

func (p *Process) SetExitCode(code int)

func (*Process) SetExited

func (p *Process) SetExited(e bool)

func (*Process) SetRunning

func (p *Process) SetRunning(r bool)

func (*Process) Start

func (p *Process) Start() (code int)

Start invokes the wasm interp and returns an error code if this is a "main" process.

func (*Process) String

func (p *Process) String() string

type Service

type Service interface {
	IsServer() bool
	IsLocal() bool
	IsRemote() bool
	GetName() string
	GetArg() []string
	GetEnv() []string
	GetWasmPath() string
	GetModule() eng.Module
	GetPluginPath() string
	GetPlugin() *plugin.Plugin
	GetPluginSymbol() string
	GetPluginAlias() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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