server

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(priceSvc *price.Service, jobSvc *job.Service) http.Handler

NewHandler creates the full HTTP handler with routes and middleware. Exported for use in tests (e.g., httptest.NewServer).

Types

type APIResponse

type APIResponse[T any] struct {
	Message string `json:"message"`
	Data    T      `json:"data"`
}

type Server

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

func New

func New(baseCtx context.Context, port string, priceSvc *price.Service, jobSvc *job.Service) *Server

New creates a server. The baseCtx is used as the base context for all incoming requests (via BaseContext). Cancelling it causes in-flight scraper workers to stop promptly during graceful shutdown.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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