Documentation ¶
Index ¶
- func LoadPlugin(ctx context.Context, plugin, symbol, name string) (apiplugin.ParigotInit, error)
- func LoadPluginAndAddHostFunc(ctx context.Context, pluginPath string, pluginSymbol string, ...) error
- type DeployContext
- func (c *DeployContext) CreateAllProcess() error
- func (c *DeployContext) LoadAllModules(e eng.Engine) error
- func (d *DeployContext) NotifyMap() *sync.Map
- func (c *DeployContext) Process() *sync.Map
- func (c *DeployContext) SearchDir() []string
- func (c *DeployContext) StartMain(mainProg string) (int, error)
- func (c *DeployContext) StartServer(ctx context.Context) ([]string, int)
- func (c *DeployContext) Timezone() string
- type ParigotExitCode
- type Process
- func (p *Process) Exit()
- func (p *Process) ExitCode() int
- func (p *Process) Exited() bool
- func (p *Process) IsRunning() bool
- func (p *Process) IsServer() bool
- func (p *Process) Run()
- func (p *Process) Running() bool
- func (p *Process) SetExitCode(code int)
- func (p *Process) SetExited(e bool)
- func (p *Process) SetRunning(r bool)
- func (p *Process) Start() (code int)
- func (p *Process) String() string
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPlugin ¶
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) 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.