rhttp

package
v3.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitServices

func InitServices(ctx context.Context, services map[string]config.ServicesConfig) (map[string]global.Service, error)

func Routes added in v3.15.0

func Routes(services map[string]global.Service, counters map[string]*activity.Counter, log *zerolog.Logger) *router.Router

Routes builds the router that serves the given services. Every service declares absolute patterns on it, so a request is matched once, against the whole server: there is no per-service prefix stripping, and two services claiming the same URL is a startup panic rather than a silent shadowing.

counters, keyed by service name, are fed by the routes of that service.

Types

type Config

type Config func(*Server)

func WithCertAndKeyFiles

func WithCertAndKeyFiles(cert, key string) Config

func WithLogger

func WithLogger(log zerolog.Logger) Config

func WithMiddlewares

func WithMiddlewares(middlewares []global.Middleware) Config

func WithRouter added in v3.15.0

func WithRouter(r *router.Router) Config

WithRouter sets the router serving the server's services, as built by Routes.

func WithServices

func WithServices(services map[string]global.Service) Config

type Server

type Server struct {
	Services map[string]global.Service // map key is service name
	CertFile string
	KeyFile  string
	// contains filtered or unexported fields
}

Server contains the server info.

func New

func New(c ...Config) (*Server, error)

New returns a new server.

func (*Server) Address

func (s *Server) Address() string

Address returns the network address.

func (*Server) GracefulStop

func (s *Server) GracefulStop() error

GracefulStop gracefully stops the server.

func (*Server) Network

func (s *Server) Network() string

Network return the network type.

func (*Server) Start

func (s *Server) Start(ln net.Listener) error

Start starts the server.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server.

Directories

Path Synopsis
Package datatx provides a library to abstract the complexity of using various data transfer protocols.
Package datatx provides a library to abstract the complexity of using various data transfer protocols.
utils/download
Package download provides a library to handle file download requests.
Package download provides a library to handle file download requests.
Package ratelimit provides a per-client token-bucket HTTP middleware, meant for unauthenticated endpoints that trigger outbound requests or other expensive work (e.g.
Package ratelimit provides a per-client token-bucket HTTP middleware, meant for unauthenticated endpoints that trigger outbound requests or other expensive work (e.g.
Package router is the HTTP routing API reva services use to declare the URLs they serve.
Package router is the HTTP routing API reva services use to declare the URLs they serve.

Jump to

Keyboard shortcuts

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