server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetTaskCommand(name string) (command string, ok bool)
}

Config declares command loader from config for given tasks

type Rest

type Rest struct {
	Listen      string
	Version     string
	SecretKey   string
	Config      Config
	Runner      Runner
	UpdateDelay time.Duration
}

Rest implement http api invoking remote execution for requested tasks

func (*Rest) Run

func (s *Rest) Run(ctx context.Context) error

Run starts http server and closes on context cancellation

type Runner

type Runner interface {
	Run(ctx context.Context, command string, logWriter io.Writer) error
}

Runner executes commands

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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