http

package
v0.0.0-...-6d10cd0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandler

func AddHandler(ctx context.Context, path string, h http.Handler)

AddHandler add http.Handler to the router on specific path

func SetDefaultHandler

func SetDefaultHandler(ctx context.Context, h http.Handler)

SetDefaultHandler sets default http.Handler for all unspecified paths

Types

type Config

type Config struct {
	// Listen address and port
	Listen string `yaml:"listen"`
}

Config config structure from Manopus HTTP server

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Server implementation of Manopus HTTP server

func Init

func Init(ctx context.Context, config Config) *Server

Init creates instance of HTTP server and starts it in background

func (*Server) AddHandler

func (s *Server) AddHandler(ctx context.Context, path string, h http.Handler)

AddHandler add http.Handler to the router on specific path

func (*Server) SetDefaultHandler

func (s *Server) SetDefaultHandler(ctx context.Context, h http.Handler)

SetDefaultHandler sets default http.Handler for all unspecified paths

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Start starts execution of HTTP server

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

Stop HTTP server

Jump to

Keyboard shortcuts

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