courier

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionMajor         = 1
	VersionMinor         = 0
	VersionPatch         = 0
	VersionReleaseLevel  = ""
	VersionReleaseNumber = 2
)

Version of the current build

Variables

View Source
var GitVersion string

Set the GitVersion via -ldflags="-X 'github.com/trisacrypto/courier/pkg.GitVersion=$(git rev-parse --short HEAD)'"

Functions

func Version

func Version() string

Returns the semantic version for the current build.

Types

type Server

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

Server defines the courier service and its webhook handlers.

func New

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

New creates a new server object from configuration but does not serve it yet.

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) Healthz added in v1.0.0

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

func (*Server) IsHealthy added in v1.0.0

func (s *Server) IsHealthy() bool

Determines if the server is healthy or not.

func (*Server) IsReady added in v1.0.0

func (s *Server) IsReady() bool

Determines if the server is ready or not.

func (*Server) Readyz added in v1.0.0

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

func (*Server) Serve

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

Serve API requests.

func (*Server) SetHealthy

func (s *Server) SetHealthy(status bool)

Set the server health state to the status bool.

func (*Server) SetReady added in v1.0.0

func (s *Server) SetReady(status bool)

Set the server ready state to the status bool.

func (*Server) SetStore

func (s *Server) SetStore(store store.Store)

SetStore directly sets the store for the server.

func (*Server) SetURL

func (s *Server) SetURL(sock net.Listener)

Set the URL of the server from the socket

func (*Server) Shutdown

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

Shutdown the server gracefully.

func (*Server) Status

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

Status returns the status of the server.

func (*Server) StoreCertificate

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

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

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

StoreCertificatePassword stores the password for an encrypted certificate and returns a 204 No Content response.

func (*Server) URL

func (s *Server) URL() string

URL returns the URL of the server.

Directories

Path Synopsis
api
v1
Package metrics provides functions for exporting prometheus metrics.
Package metrics provides functions for exporting prometheus metrics.

Jump to

Keyboard shortcuts

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