server

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func URLParam

func URLParam(r *http.Request, key string) string

Types

type Mux

type Mux = chi.Mux

type Options

type Options struct {
	Addr          string
	TlsCertPath   string
	TlsKeyPath    string
	HeartBeatPath string
	Database      *database.DB
	Engine        *templates.Engine
}

type RouteGroup

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

func (*RouteGroup) RegisterService

func (rg *RouteGroup) RegisterService(service ServiceHandler)

func (*RouteGroup) Use

func (rg *RouteGroup) Use(mw ...func(http.Handler) http.Handler) *RouteGroup

type Router

type Router = chi.Router

type Server

type Server struct {
	Mux     *Mux
	Options *Options
}

func New

func New(options *Options) *Server

func (*Server) AttachDebug

func (s *Server) AttachDebug()

func (*Server) Group

func (s *Server) Group(path string) *RouteGroup

func (*Server) Listen

func (s *Server) Listen()

func (*Server) RegisterService

func (s *Server) RegisterService(service ServiceHandler)

func (*Server) ServeStatic

func (s *Server) ServeStatic(route string, staticFiles embed.FS, dir string)

func (*Server) Use

func (s *Server) Use(middlewares ...func(http.Handler) http.Handler)

type ServiceHandler

type ServiceHandler func(mux *chi.Mux, db *database.DB, tpl *templates.Engine)

Source Files

  • server.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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