web

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = &ErrResponse{HTTPStatusCode: 404, StatusText: "Resource not found."}

Functions

func ErrRender

func ErrRender(err error) render.Renderer

Types

type EmbeddableResources

type EmbeddableResources struct {
	Favicon   []byte
}

type ErrResponse

type ErrResponse struct {
	Err            error `json:"-"` // low-level runtime error
	HTTPStatusCode int   `json:"-"` // http response status code

	StatusText string `json:"status"`          // user-level status message
	AppCode    int64  `json:"code,omitempty"`  // application-specific error code
	ErrorText  string `json:"error,omitempty"` // application-level error message, for debugging
}

func (*ErrResponse) Render

func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error

type PostForm

type PostForm map[string][]string

func (PostForm) Get

func (f PostForm) Get(key string) string

func (PostForm) GetObject

func (f PostForm) GetObject(key string) PostForm

type Renderer

type Renderer struct {
}

func (*Renderer) HTML

func (renderer *Renderer) HTML(w http.ResponseWriter, r *http.Request, info views.LayoutInfo, view templ.Component)

type Server

type Server struct {
	Config     *krab.Config
	Connection krabdb.Connection
	EmbeddableResources
	// contains filtered or unexported fields
}

func (*Server) Help

func (a *Server) Help() string

func (*Server) Run

func (s *Server) Run(args []string) int

func (*Server) Synopsis

func (a *Server) Synopsis() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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