features

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHealthCheck

func AddHealthCheck(api huma.API, path string, serviceName string, version string)

AddHealthCheck adds a standard health check endpoint to a Huma API

func CustomHealthCheck

func CustomHealthCheck(api huma.API, path string, healthFunc func(ctx context.Context) (*HealthResponse, error))

CustomHealthCheck allows users to provide their own health check logic

func Greet

func Greet(api huma.API, opts GreetOptions)

Greet displays the GoFlux logo and service information

func QuickGreet

func QuickGreet(serviceName, version, host string, port int)

QuickGreet is a simplified version that takes fewer parameters

Types

type GreetOptions

type GreetOptions struct {
	ServiceName string
	Version     string
	Host        string
	Port        int
	ProxyPort   int
	DevMode     bool
	DocsPath    string // Optional: path to API docs (e.g., "/api/docs")
	OpenAPIPath string // Optional: path to OpenAPI spec (e.g., "/api/openapi")
}

GreetOptions configures the greeting display

type HealthResponse

type HealthResponse struct {
	Body struct {
		Status  string `json:"status" example:"ok" doc:"Service status"`
		Message string `json:"message,omitempty" example:"Service is running" doc:"Optional status message"`
		Version string `json:"version,omitempty" example:"1.0.0" doc:"Optional service version"`
	}
}

HealthResponse represents a standard health check response

Jump to

Keyboard shortcuts

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