server

package
v0.0.0-...-fa1d128 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package server provides functionality for managing server operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(database *db.DB, config *config.Config) http.Handler

NewRouter creates a new HTTP router with all the API endpoints.

Types

type Server

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

func New

func New(db *db.DB, configs ...config.ConfigFunc) (server *Server)

New creates a new instance of Server with the provided database and optional configuration functions.

Params:

  db *db.DB // The database instance.
	configs...config.ConfigFunc // Optional configuration functions.

Returns:

*Server // A new instance of Server with the provided database and optional configuration functions.

func (*Server) Start

func (server *Server) Start(port string) error

Start starts the server and listens on the specified port.

Params:

port string // The port to listen on.

Directories

Path Synopsis
api
get
Package config provides methods for configuring backend
Package config provides methods for configuring backend
Package exception provides some additional errors for specific exceptions
Package exception provides some additional errors for specific exceptions
Package middleware provides some basic middlewares setup for server-side
Package middleware provides some basic middlewares setup for server-side
Package mux implements HTTP request multiplexer based on standard type http.ServeMux with some additional fields
Package mux implements HTTP request multiplexer based on standard type http.ServeMux with some additional fields
Package utils provides fast and useful utilities for working with specific cases
Package utils provides fast and useful utilities for working with specific cases

Jump to

Keyboard shortcuts

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