api

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 10 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 ConfigureRouter

func ConfigureRouter(debug bool) *gin.Engine

func RegisterHealthChecker added in v0.37.0

func RegisterHealthChecker(hc HealthChecker)

RegisterHealthChecker adds a health checker to be queried during health checks

func ResetHealthCheckers added in v0.37.0

func ResetHealthCheckers()

ResetHealthCheckers clears all registered health checkers. This is intended for use in tests to prevent state leakage between tests.

Types

type API

type API interface {
	Start() error
	AddRoute(method, path string, handler gin.HandlerFunc)
}

type APIOption

type APIOption func(*APIv1)

func WithGroup

func WithGroup(group string) APIOption

func WithHost

func WithHost(host string) APIOption

func WithPort

func WithPort(port uint) APIOption

type APIRouteRegistrar

type APIRouteRegistrar interface {
	RegisterRoutes()
}

type APIv1

type APIv1 struct {
	ApiGroup *gin.RouterGroup
	Host     string
	Port     uint
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *APIv1

func New

func New(debug bool, options ...APIOption) *APIv1

func (*APIv1) AddRoute

func (a *APIv1) AddRoute(method, path string, handler gin.HandlerFunc)

func (*APIv1) Engine

func (a *APIv1) Engine() *gin.Engine

func (*APIv1) Start

func (a *APIv1) Start() error

@license.name Apache 2.0 @license.url http://www.apache.org/licenses/LICENSE-2.0.html

type HealthChecker added in v0.37.0

type HealthChecker interface {
	IsRunning() bool
}

HealthChecker is an interface for components that can report their health status

Jump to

Keyboard shortcuts

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