quarterdeck

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: BSD-3-Clause Imports: 27 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
}

Server implements the API router and handlers.

func New

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

func (*Server) APIKeyCreate

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

TODO: document TODO: actually implement this resource endpoint HACK: this is just a quick hack to get us going: it creates an api key quickly

func (*Server) APIKeyDelete

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

func (*Server) APIKeyDetail

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

func (*Server) APIKeyList

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

TODO: document TODO: actually implement this resource endpoint TODO: implement pagination HACK: this is just a quick hack to get us going, it should filter api keys based on the authenticated user and organization instead of just returning everyting.

func (*Server) APIKeyUpdate

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

func (*Server) Authenticate

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

TODO: add documentation TODO: simplify the code in this handler

func (*Server) Available

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

Available is middleware that uses healthy boolean to return a service unavailable http status code if the server is shutting down or in maintenance mode. This middleware must be fairly early on in the chain to ensure that complex handling does not slow the shutdown of the server.

func (*Server) Healthy

func (s *Server) Healthy() bool

func (*Server) Login

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

TODO: add documentation TODO: simplify the code in this handler

func (*Server) Refresh

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

func (*Server) Register

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

TODO: add documentation TODO: review and ensure the register methodology is what we want

func (*Server) Serve

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

Serve API requests while listening on the specified bind address.

func (*Server) SetHealth

func (s *Server) SetHealth(health bool)

func (*Server) SetURL

func (s *Server) SetURL(url string)

func (*Server) Shutdown

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

Shutdown the server gracefully (usually called by OS signal).

func (*Server) Status

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

Status handler returns the current healthy status of the server (can't be unhealthy otherwise the Available middleware would have intercepted the request)

func (*Server) URL

func (s *Server) URL() string

Directories

Path Synopsis
api
v1
Package db establishes a connection with a Raft replicated sqlite3 database.
Package db establishes a connection with a Raft replicated sqlite3 database.

Jump to

Keyboard shortcuts

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