web

package
v0.0.0-...-852c197 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, error string, code int)

Types

type Command

type Command struct {
	Name    string `json:"command"`
	Payload any    `json:"payload"`
}

type ExecRequestPayload

type ExecRequestPayload struct {
	EscapedPath string `json:"path"`
	Name        string `json:"name"`
	Scope       string `json:"scope"`
	Environment string `json:"environment"`
}

type ExecResponsePayload

type ExecResponsePayload struct {
	OutputFragment string `json:"fragment"`
}

type Router

type Router struct {
	*chi.Mux
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(isReadonly bool) (*Router, error)

func (*Router) Render

func (r *Router) Render(w http.ResponseWriter, status int, page string, data any)

func (*Router) RequestError

func (r *Router) RequestError(w http.ResponseWriter, err error)

func (*Router) ServerError

func (r *Router) ServerError(w http.ResponseWriter, err error)

type TemplateCache

type TemplateCache map[string]*template.Template

func NewTemplateCache

func NewTemplateCache() (TemplateCache, error)

type UnparsedCommand

type UnparsedCommand struct {
	Command string          `json:"command"`
	Payload json.RawMessage `json:"payload"`
}

type ViewRequestPayload

type ViewRequestPayload struct {
	EscapedPath string `json:"path"`
	Name        string `json:"name"`
	Scope       string `json:"scope"`
	Environment string `json:"environment"`
}

type ViewResponsePayload

type ViewResponsePayload struct {
	ReplacedScript string `json:"script"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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