httpserver

package
v0.0.0-...-e6e2e8d Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package httpserver manages server creation and api routing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	DB     *sql.DB
	Engine *gin.Engine
	Config configpkg.Config
}

Server holds db connection, handlers router and configuration.

func New

func New(conn *sql.DB, logger zerolog.Logger, config configpkg.Config) (*Server, error)

New creates Server type with instantiated domains and routes.

func (*Server) ServeHTTP

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

ServeHTTP implements the http.Handler interface for the Server type.

Jump to

Keyboard shortcuts

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