server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(c echo.Context) error

func MonitorServer

func MonitorServer(serverConfig MonitorServerConfig, assetConfig assets.Config, templateGlobals pongo2.Context, configFns ...func(e *echo.Echo) error) context.Context

MonitorServer starts the monitoring web service

func StaticGet

func StaticGet(root fs.FS, mimeType string) echo.HandlerFunc

func StaticHead

func StaticHead(root fs.FS, mimeType string) echo.HandlerFunc

Types

type Liveness

type Liveness interface {
	Liveness() time.Time
}

Liveness implements the interface to wire up a Liveness check from another subsystem

type LivenessResponse

type LivenessResponse struct {
	RespondedAt time.Time `json:"responded_at"`
}

LivenessResponse is a common type for responding to K8S style liveness checks.

type MonitorServerConfig

type MonitorServerConfig struct {
	// Ctx should be a context object which can signal server shutdown. If nil, not used.
	Ctx      context.Context `kong:"-"`
	Liveness Liveness        `kong:"-"`

	Prefix string `help:"Prefix the API is bing served under, if any"`
	Host   string `help:"Host the API should be served on" default:""`
	Port   int    `help:"Port to serve on" default:"8080"`
}

type ReadinessResponse

type ReadinessResponse struct {
	RespondedAt time.Time `json:"responded_at"`
}

ReadinessResponse is a common type for responding to K8S style readiness checks.

type StartedResponse

type StartedResponse struct {
	RespondedAt time.Time `json:"responded_at"`
}

StartedResonse is a common type for responding to K8S style startup checks.

Jump to

Keyboard shortcuts

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