relay

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 11 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              = 0   // successful termination
	ExitGeneral         = 1   // catchall for errors
	ExitNoUser          = 67  // user unknown
	ExitNoRelay         = 68  // relay name unknown
	ExitUnavailable     = 69  // relay unavailable
	ExitInternalError   = 70  // internal software error
	ExitSystemErr       = 71  // system error (e.g., can't spawn worker)
	ExitTimeout         = 72  // timeout exceeded
	ExitIoErr           = 74  // input/output error
	ExitTempFail        = 75  // temp failure; user can retry
	ExitProtocol        = 76  // remote error in protocol
	ExitNoPerm          = 77  // permission denied
	ExitCannotInvoke    = 126 //  Command invoked cannot execute
	ExitCommandNotFound = 127 // "command not found"
)

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.CommandResponse)

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