doofweb

package module
v0.0.0-...-0cc14dd Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 10 Imported by: 0

README

doofweb

doof-web, a stupid web framework

  • Includes minimal routing
  • Will Will pass a postgres database pool to your view
  • Thats it

There is something in examples folder which kinda shows what the idea is supposed to be

Definitely use this in production

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ViewFunc

type ViewFunc func(*W2GViewData) error

type W2GServer

type W2GServer struct {
	DBUrl   string
	Addr    string
	Resp404 string
	Paths   map[string]ViewFunc
	// contains filtered or unexported fields
}

func (W2GServer) RunServer

func (w2gs W2GServer) RunServer()

func (W2GServer) ServeHTTP

func (w2gs W2GServer) ServeHTTP(resp http.ResponseWriter, req *http.Request)

type W2GViewData

type W2GViewData struct {
	Resp   http.ResponseWriter
	Req    *http.Request
	DBPool *pgxpool.Pool
}

func (*W2GViewData) UnmarshalJsonBody

func (vd *W2GViewData) UnmarshalJsonBody(dest any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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