cosmos

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

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 New

func New(conf config.Config) (s *Server, err error)

func (*Server) Available

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

Available is middleware that uses the healthy boolean to return a service unavailable http status code if the server is shutting down. It does this before all routes to ensure that complex handling doesn't bog down the server.

func (*Server) Healthz

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

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

func (*Server) Login

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

func (*Server) Logout

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

func (*Server) NotAllowed

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

func (*Server) NotFound

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

func (*Server) Readyz

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

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

func (*Server) Reauthenticate

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

func (*Server) Register

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

func (*Server) Serve

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

func (*Server) SetStatus

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

SetHealth sets the health status on the API server, putting it into unavailable mode if health is false, and removing maintenance mode if health is true. Here primarily for testing purposes since it is unlikely an outside caller can access this.

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Status

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

Status is an unauthenticated endpoint that returns the status of the api server and can be used for heartbeats and liveness checks. This status method is the global status method, meaning it returns the latest version of the whipser service, no matter how many API versions are available.

func (*Server) URL

func (s *Server) URL() string

URL returns the URL of the server determined by the socket addr.

Jump to

Keyboard shortcuts

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