http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(controller RecipeRunController, cfg *config.Config, log *logrus.Logger) *API

func (*API) Start

func (api *API) Start() error

type Controller

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

func NewController

func NewController(receiptExecutor RecipeExecutor, log *logrus.Logger) *Controller

func (*Controller) RunRecipe

func (c *Controller) RunRecipe(sshExecutor shared.SSHExecutor, runRecipe *SSHRecipeRq) (*SSHRecipeRs, error)

type RecipeExecutor

type RecipeExecutor interface {
	Execute(sshExecutor shared.SSHExecutor, recipe []string, timeout time.Duration) ([]string, string, error)
}

type RecipeRunController

type RecipeRunController interface {
	RunRecipe(shared.SSHExecutor, *SSHRecipeRq) (*SSHRecipeRs, error)
}

type SSHRecipeRq

type SSHRecipeRq struct {
	Host    string        `json:"host" binding:"required"`
	Port    int           `json:"port" binding:"required"`
	Recipe  []string      `json:"recipe" binding:"required"`
	Timeout time.Duration `json:"timeout"`
}

func (SSHRecipeRq) Validate

func (r SSHRecipeRq) Validate() error

type SSHRecipeRs

type SSHRecipeRs struct {
	Response    []string `json:"response"`
	ResponseErr string   `json:"responseErr"`
	Error       string   `json:"error"`
}

Jump to

Keyboard shortcuts

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