serverx

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mb uint64 = 1_048_576 // number of bytes in a MB
View Source
var MetricTicker = time.NewTicker(metricTickerInterval)

Functions

func CollectCpuIOMetrics

func CollectCpuIOMetrics()

func CollectDiskIOMetrics

func CollectDiskIOMetrics()

func CollectNetIOMetrics

func CollectNetIOMetrics()

func CollectRuntimeResourceMetrics

func CollectRuntimeResourceMetrics()

Types

type Server

type Server struct {
	Server *http.Server
	Router chi.Router
	Addr   string
	UseTls bool
}

func NewApi

func NewApi(ctx context.Context, addr string, router chi.Router, useTls bool) *Server

func (*Server) Serve

func (api *Server) Serve(ctx context.Context) error

Serve starts the HTTP server in a goroutine and sends errors to the provided error channel.

func (*Server) Shutdown

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

Jump to

Keyboard shortcuts

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