Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Logger *slog.Logger
// The Maximum number of clients to allow for this openvpn gateway before setting overloaded=true
MaxClients int
// Where to HTTP GET the openvpn exporter metrics which is expected to be
// the standard report from the openvpn prometheus exporter.
ExporterURL string
}
type OpenVPNPlugin ¶
type OpenVPNPlugin struct {
// contains filtered or unexported fields
}
func NewOpenVPNPlugin ¶
func NewOpenVPNPlugin(ctx context.Context, config Config) *OpenVPNPlugin
func (*OpenVPNPlugin) Transform ¶
func (p *OpenVPNPlugin) Transform(in models.ModelsGateway) (models.ModelsGateway, error)
Transform will fetch from the exporter url, determine the number of connected clients by `openvpnExporterClients` and change the Overloaded value to `true` if the current number exceeds the configured maxClients
Source Files
¶
- openvpn.go
Click to show internal directories.
Click to hide internal directories.