server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, status int, err *types.ErrorV1)

func ErrorString

func ErrorString(w http.ResponseWriter, status int, code string, err error)

func JSON

func JSON(w http.ResponseWriter, code int, v any, pretty bool)

func JSONOK

func JSONOK(w http.ResponseWriter, v any, pretty bool)

Types

type Server

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

func New

func New() *Server

func (*Server) Init

func (s *Server) Init() *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

func (*Server) WithConfig

func (s *Server) WithConfig(config *config.Service) *Server

func (*Server) WithDatabase

func (s *Server) WithDatabase(db *database.Database) *Server

func (*Server) WithReadiness

func (s *Server) WithReadiness(fn func(context.Context) error) *Server

func (*Server) WithRouter

func (s *Server) WithRouter(router *http.ServeMux) *Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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