relay

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

Gort Relay

Currently this is only a simple bit of Go code loosely-integrated into the Gort server, but eventually this will be broken out into a standalone service that can be deployed independently (and possibly remotely).

Documentation

Index

Constants

View Source
const (
	// ExitOK represents a successful termination.
	ExitOK = 0

	// ExitGeneral is catchall for otherwise unspecified errors.
	ExitGeneral = 1

	// ExitNoUser represents a "user unknown" error.
	ExitNoUser = 67

	// ExitNoRelay represents "relay name unknown" error.
	ExitNoRelay = 68

	// ExitUnavailable represents a "relay unavailable" error.
	ExitUnavailable = 69

	// ExitInternalError represents an internal software error. It's returned
	// if a command has a failure that's detectable by the framework.
	ExitInternalError = 70

	// ExitSystemErr represents a system (Gort) error (for example, it can't
	// spawn a worker).
	ExitSystemErr = 71

	// ExitTimeout represents a timeout exceeded.
	ExitTimeout = 72

	// ExitIoErr represents an input/output error.
	ExitIoErr = 74

	// ExitTempFail represents a temporary failure. The user can retry.
	ExitTempFail = 75

	// ExitProtocol represents a remote error in protocol.
	ExitProtocol = 76

	// ExitNoPerm represents a permission denied.
	ExitNoPerm = 77

	// ExitCannotInvoke represents that the invoked command cannot execute.
	// TODO(mtitmus) What does this mean, exactly?
	ExitCannotInvoke = 126

	// ExitCommandNotFound represents that the command can't be found.
	ExitCommandNotFound = 127
)

Variables

This section is empty.

Functions

func AuthorizeUser

func AuthorizeUser(commandRequest data.CommandRequest, user rest.User) (bool, error)

AuthorizeUser is not yet implemented, and will not be until remote relays become a thing. For now, all authentication is done by the command execution framework (which, in turn, invokes a/the relay).

func SpawnWorker

func SpawnWorker(ctx context.Context, command data.CommandRequest) (worker.Worker, error)

SpawnWorker receives a CommandEntry and a slice of command parameters strings, and constructs a new worker.Worker.

func StartListening

func StartListening() (chan<- data.CommandRequest, <-chan data.CommandResponseEnvelope)

StartListening instructs the relay to begin listening for incoming command requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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