Documentation
¶
Index ¶
Constants ¶
const ( SubTypeFull = iota SubTypeLite SubTypeDomain )
Variables ¶
var (
ClientHandler = BroadcastManager{}
)
Functions ¶
func IPWhitelist ¶ added in v1.4.0
IPWhitelist is a middleware that checks if the IP of the client is in the whitelist.
func SetExampleCert ¶
func SetExampleCert(cert certstream.Entry)
Types ¶
type BroadcastManager ¶
type BroadcastManager struct {
Broadcast chan certstream.Entry
// contains filtered or unexported fields
}
func (*BroadcastManager) ClientDomainsCount ¶
func (bm *BroadcastManager) ClientDomainsCount() (count int64)
ClientDomainsCount returns the current number of clients connected to the service on the `domains-only` endpoint.
func (*BroadcastManager) ClientFullCount ¶
func (bm *BroadcastManager) ClientFullCount() (count int64)
ClientFullCount returns the current number of clients connected to the service on the `full` endpoint.
func (*BroadcastManager) ClientLiteCount ¶
func (bm *BroadcastManager) ClientLiteCount() (count int64)
ClientLiteCount returns the current number of clients connected to the service on the `lite` endpoint.
type SubscriptionType ¶
type SubscriptionType int
type WebServer ¶
type WebServer struct {
// contains filtered or unexported fields
}
func NewMetricsServer ¶
NewMetricsServer creates a new webserver that listens on the given port and provides metrics for a prometheus server.
func NewWebsocketServer ¶
NewWebsocketServer starts a new webserver and initialized it with the necessary routes. It also starts the broadcaster in ClientHandler as a background job.
func (*WebServer) RegisterPrometheus ¶
func (ws *WebServer) RegisterPrometheus(url string, callback func(w io.Writer, exposeProcessMetrics bool))
RegisterPrometheus registers a new handler that listens on the given url and calls the given function in order to provide metrics for a prometheus server. This function signature was used, because VictoriaMetrics offers exactly this function signature.