rest

package
v0.0.0-...-c162711 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve() error

Serve initializes and starts the HTTP server. Handles graceful shutdown when receiving termination signals.

Types

type APIResponse

type APIResponse struct {
	Message            string     `json:"message"`
	Version            string     `json:"version"`
	APIVersion         string     `json:"api_version"`
	Timestamp          string     `json:"timestamp"`
	AvailableEndpoints []Endpoint `json:"available_endpoints"`
	CreatedBy          string     `json:"created_by"`
	License            string     `json:"license"`
}

type Dependency

type Dependency struct {
	Status       string `json:"status" example:"up"`
	ResponseTime string `json:"response_time,omitempty" example:"48ms"`
}

type Endpoint

type Endpoint struct {
	Path        string `json:"path"`
	Description string `json:"description"`
}

type HealthcheckResponse

type HealthcheckResponse struct {
	Status       string                `json:"status" example:"operational"`
	SystemInfo   SystemInfo            `json:"systemInfo"`
	Dependencies map[string]Dependency `json:"dependencies"`
}

type SystemInfo

type SystemInfo struct {
	Environment string `json:"environment" example:"prod"`
	Uptime      string `json:"uptime" example:"3h 26m 30s"`
	LastChecked string `json:"last_checked" example:"2024-09-24T00:41:20+05:00"`
}

Jump to

Keyboard shortcuts

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