process

package
v0.0.0-...-8306ff7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteShellCommand

func ExecuteShellCommand(cmdArr []string) error

func IsProcessUp

func IsProcessUp(client *http.Client, cfg *config.Upcheck) (bool, error)

Types

type DockerControl

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

DockerControl represents process control for a docker container

func (*DockerControl) Start

func (dc *DockerControl) Start() error

Stop implements Process.Stop

func (*DockerControl) Status

func (dc *DockerControl) Status() bool

Status implements Process.Status

func (*DockerControl) Stop

func (dc *DockerControl) Stop() error

Stop implements Process.Stop

func (*DockerControl) UpdateStatus

func (dc *DockerControl) UpdateStatus() bool

UpdateStatus implements Process.UpdateStatus

func (*DockerControl) WaitToBeDown

func (dc *DockerControl) WaitToBeDown() bool

WaitToBeDown waits for the process status to be down by performing up check repeatedly for a certain duration

func (*DockerControl) WaitToComeUp

func (dc *DockerControl) WaitToComeUp() bool

WaitToComeUp waits for the process status to be up by performing up check repeatedly for a certain duration

type Process

type Process interface {
	// Start starts the process. it returns error if it fails.
	Start() error
	// Stop stops the process. it returns error if it fails.
	Stop() error
	// UpdateStatus performs a status check of the process, and caches the result before returning
	UpdateStatus() bool
	// Status returns the cached status
	Status() bool
}

Process is an interface that represents blockchain client or privacy manager process It allows a process to be stopped & started. It allows the process's status to be checked. This should be used by node controller to control blockchain client, privacyManager.

func NewDockerProcess

func NewDockerProcess(c *http.Client, p *config.Process, s bool) Process

func NewShellProcess

func NewShellProcess(c *http.Client, p *config.Process, s bool) Process

type ShellProcessControl

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

ShellProcessControl represents process control for a shell process

func (*ShellProcessControl) Start

func (sp *ShellProcessControl) Start() error

Status implements Process.Start

func (*ShellProcessControl) Status

func (sp *ShellProcessControl) Status() bool

Status implements Process.Status

func (*ShellProcessControl) Stop

func (sp *ShellProcessControl) Stop() error

Status implements Process.Stop

func (*ShellProcessControl) UpdateStatus

func (sp *ShellProcessControl) UpdateStatus() bool

UpdateStatus implements Process.UpdateStatus

func (*ShellProcessControl) WaitToBeDown

func (sp *ShellProcessControl) WaitToBeDown() bool

TODO create helper that can be called from docker as well WaitToBeDown waits for the process status to be down by performing up check repeatedly for a certain duration

func (*ShellProcessControl) WaitToComeUp

func (sp *ShellProcessControl) WaitToComeUp() bool

TODO create helper method that can be called from docker as well WaitToComeUp waits for the process status to be up by performing up check repeatedly for a certain duration

type UpcheckResponse

type UpcheckResponse struct {
	Result interface{}    `json:"result"`
	Error  *core.RpcError `json:"error"`
}

Jump to

Keyboard shortcuts

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