server

package
v0.0.0-...-c54d25a Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const N = 100

Variables

View Source
var R = rand.New(rand.NewSource(time.Now().UnixNano()))

Functions

func ErrorHandler

func ErrorHandler(w http.ResponseWriter, r *http.Request, err error)

Types

type ContextKey

type ContextKey string
const (
	CtxKeyTodo   ContextKey = "todo"
	CtxKeyStatus ContextKey = "status"
)

type Server

type Server struct {
	Router  *chi.Mux
	Query   *db.Queries
	Context context.Context
}

func New

func New() Server

func (*Server) DeleteTodoId

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

func (*Server) GetAlpine

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

func (*Server) GetAssets

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

func (*Server) GetGmtResult

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

func (*Server) GetIndex

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

func (*Server) GetNewTodo

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

func (*Server) GetNumbersApi

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

func (*Server) GetProject

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

func (*Server) GetTodo

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

func (*Server) GetTodoId

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

func (*Server) PostFeedback

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

func (*Server) PostTodo

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

func (*Server) PostTodoId

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

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers()

func (*Server) TodoCtx

func (s *Server) TodoCtx(next http.Handler) http.Handler

func (*Server) WriteTodosTable

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

Jump to

Keyboard shortcuts

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