daemon

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DaemonPort is the port the daemon uses to accept connections
	DaemonPort = "4321"

	// DaemonMajorVersion current version of the daemon
	DaemonMajorVersion = 1

	// DaemonMinorVersion current minor version of the daemon
	DaemonMinorVersion = 0
)

Variables

This section is empty.

Functions

func EnsureDaemon

func EnsureDaemon() error

EnsureDaemon makes sure a daemon of the right version is up and running. This method will either panic or return after the daemon is up and running.

func Handshake

func Handshake() (int8, error)

Handshake connects and sends a handshake request to the daemon. Return the version of the daemon that answered.

func KillDaemon

func KillDaemon()

KillDaemon will kill the process with the PID stored in the daemon.pid file

func SetVariables

func SetVariables(seVariablesRequest session.SetVariableRequest) error

SetVariables sends variables to be set in the global session

func WriteDaemonPID

func WriteDaemonPID() error

WriteDaemonPID writes the PID of the current process to a file in the go-http-cli process dir

Types

type HandshakeResponse

type HandshakeResponse struct {
	MajorVersion int8
	MinorVersion int8
}

HandshakeResponse is the response sent by the daemon when someone is checking if it's up.

type RequestExecution

type RequestExecution struct {
	RequestResponses []request.ExecutedRequestResponse
	ErrorMessage     string
}

RequestExecution is the response from the daemon when executing a request.

func ExecuteRequest

func ExecuteRequest(executionContext request.ExecutionContext) (*RequestExecution, error)

ExecuteRequest request the daemon to execute a request

Jump to

Keyboard shortcuts

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