Documentation ¶
Index ¶
- Constants
- Variables
- func Version() string
- type Server
- func (s *Server) Available() gin.HandlerFunc
- func (s *Server) Healthz(c *gin.Context)
- func (s *Server) IsHealthy() bool
- func (s *Server) IsReady() bool
- func (s *Server) Readyz(c *gin.Context)
- func (s *Server) Serve() (err error)
- func (s *Server) SetHealthy(status bool)
- func (s *Server) SetReady(status bool)
- func (s *Server) SetStore(store store.Store)
- func (s *Server) SetURL(sock net.Listener)
- func (s *Server) Shutdown() (err error)
- func (s *Server) Status(c *gin.Context)
- func (s *Server) StoreCertificate(c *gin.Context)
- func (s *Server) StoreCertificatePassword(c *gin.Context)
- func (s *Server) URL() string
Constants ¶
const ( VersionMajor = 1 VersionMinor = 0 VersionPatch = 0 VersionReleaseLevel = "" VersionReleaseNumber = 2 )
Version of the current build
Variables ¶
var GitVersion string
Set the GitVersion via -ldflags="-X 'github.com/trisacrypto/courier/pkg.GitVersion=$(git rev-parse --short HEAD)'"
Functions ¶
Types ¶
type Server ¶
Server defines the courier service and its webhook handlers.
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. This middleware must be first in the chain to ensure that complex handling to slow the shutdown of the server.
func (*Server) SetHealthy ¶
Set the server health state to the status bool.
func (*Server) StoreCertificate ¶
StoreCertificate decodes a base64-encoded certificate in the request, decrypts it using the password in the store, and stores the decrypted certificate in the store. The NoDecrypt option can be used to skip the decryption and store the certificate in its encrypted form.
func (*Server) StoreCertificatePassword ¶
StoreCertificatePassword stores the password for an encrypted certificate and returns a 204 No Content response.