server

package
v0.0.0-...-254d0ff Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONError

func JSONError(w http.ResponseWriter, status int, err string)

func JSONResponse

func JSONResponse(w http.ResponseWriter, status int, data any)

Types

type Server

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

func NewServer

func NewServer(port int, trustProxyCount uint, db *db.DB) (*Server, error)

func (*Server) CreateItem

func (s *Server) CreateItem(w http.ResponseWriter, r *http.Request)

CreateItem creates a new item

func (*Server) GetItem

func (s *Server) GetItem(w http.ResponseWriter, r *http.Request)

GetItem returns either the full item, deleting it afterwards if necessary, or just a preview

func (*Server) HandleSPA

func (s *Server) HandleSPA(w http.ResponseWriter, r *http.Request)

func (*Server) Health

func (s *Server) Health(w http.ResponseWriter, r *http.Request)

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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