provider

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const RestartExitCode = 99

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Pid           int
	Status        Status
	StatusMessage string
}

type Provider

type Provider struct {

	// A prototype of the process' command.
	Cmd *exec.Cmd

	Process *process.Process

	// A pointer to provider info, which allows referencing provider
	// info by the host consumers without holding reference to provider
	// instance itself.
	Info *Info
	// contains filtered or unexported fields
}

func Start

func Start(cmd *exec.Cmd) (*Provider, error)

func (*Provider) Post

func (p *Provider) Post(req *schema.Request) (*schema.Response, error)

func (*Provider) Terminate

func (p *Provider) Terminate(status Status, message string) Status

func (*Provider) Wait

func (p *Provider) Wait() Status

type Status

type Status int
const (
	PsInitializing Status // Host application is reading headers
	PsRunning             // Host application is reading messages
	PsCompleted           // Process has exited normally
	PsFailed              // Process was terminated or exited with non-zero code
)

func (Status) String

func (s Status) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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