web

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package web provides an implementation of a web UI that can be enabled to access and manage a single replica or the cluster of replicas if that replica is the leader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Debug added in v0.2.0

func Debug(conf config.WebConfig, srv *http.Server) (s *Server, err error)

Debug returns a server that uses the specified http server instead of creating one. This function is primarily used to create test servers easily.

func New

func New(conf config.WebConfig) (srv *Server, err error)

func (*Server) Healthz added in v0.2.0

func (s *Server) Healthz(c *gin.Context)

Healthz is used to alert k8s to the health/liveness status of the server.

func (*Server) Maintenance added in v0.2.0

func (s *Server) Maintenance() gin.HandlerFunc

If the server is in maintenance mode, aborts the current request and renders the maintenance mode page instead. Returns nil if not in maintenance mode.

func (*Server) NotAllowed added in v0.2.0

func (s *Server) NotAllowed(c *gin.Context)

Renders the "invalid action page"

func (*Server) NotFound added in v0.2.0

func (s *Server) NotFound(c *gin.Context)

Renders the "not found page"

func (*Server) Readyz added in v0.2.0

func (s *Server) Readyz(c *gin.Context)

Readyz is used to alert k8s to the readiness status of the server.

func (*Server) Serve

func (s *Server) Serve(errc chan<- error) (err error)

func (*Server) SetStatus added in v0.2.0

func (s *Server) SetStatus(health, ready bool)

SetStatus sets the health and ready status on the server, modifying the behavior of the kubernetes probe responses.

func (*Server) Shutdown

func (s *Server) Shutdown() (err error)

func (*Server) Status added in v0.2.0

func (s *Server) Status(c *gin.Context)

Status reports the version and uptime of the server

func (*Server) URL added in v0.2.0

func (s *Server) URL() string

URL returns the endpoint of the server as determined by the configuration and the socket address and port (if specified).

Jump to

Keyboard shortcuts

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