router

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilesHandler added in v0.3.0

func FilesHandler(w http.ResponseWriter, r *http.Request)

func NewRouter

func NewRouter() *chi.Mux

func RandomString added in v0.2.0

func RandomString(length int) []byte

func RunCommand

func RunCommand(data *CommandRequest, resp *CommandResponse, done chan<- bool)

func RunCommandWithArgsHandler

func RunCommandWithArgsHandler(w http.ResponseWriter, r *http.Request)

func ShowConfigHandler

func ShowConfigHandler(w http.ResponseWriter, r *http.Request)

Types

type CommandRequest

type CommandRequest struct {
	Name string   `json:"name"`
	Args []string `json:"args,omitempty"`
}

func (*CommandRequest) Bind

func (c *CommandRequest) Bind(r *http.Request) error

type CommandResponse

type CommandResponse struct {
	Cmd         string   `json:"cmd"`
	Msg         string   `json:"msg"`
	Rc          int      `json:"rc"`
	Stderr      string   `json:"stderr"`
	StderrLines []string `json:"stderr_lines"`
	Stdout      string   `json:"stdout"`
	StdoutLines []string `json:"stdout_lines"`
}

func NewCommandResponse

func NewCommandResponse() *CommandResponse

func (*CommandResponse) Render

type ShowConfigResponse

type ShowConfigResponse struct {
	*config.Options
}

func NewShowConfigResponse

func NewShowConfigResponse() *ShowConfigResponse

func (*ShowConfigResponse) Render

Jump to

Keyboard shortcuts

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