plugins

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 46 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Host: localhost:8081 swagger:meta

Index

Constants

View Source
const (
	MODULE = "NGINX-AGENT"

	AGENT_START_MESSAGE             = "nginx-agent %s started on %s with pid %s"
	AGENT_STOP_MESSAGE              = "nginx-agent %s (pid: %s) stopped on %s"
	NGINX_FOUND_MESSAGE             = "nginx-v%s master process was found with a pid %s"
	NGINX_STOP_MESSAGE              = "nginx-v%s master process (pid: %s) stopped"
	NGINX_RELOAD_SUCCESS_MESSAGE    = "nginx-v%s master process (pid: %s) reloaded successfully"
	NGINX_RELOAD_FAILED_MESSAGE     = "nginx-v%s master process (pid: %s) failed to reload"
	NGINX_WORKER_START_MESSAGE      = "new worker process started with pid %s for nginx-v%s process (pid: %s)"
	NGINX_WORKER_STOP_MESSAGE       = "worker process with pid %s is shutting down for nginx-v%s process (pid: %s)"
	CONFIG_APPLY_SUCCESS_MESSAGE    = "successfully applied config on %s"
	CONFIG_APPLY_FAILURE_MESSAGE    = "failed to apply nginx config on %s"
	CONFIG_ROLLBACK_SUCCESS_MESSAGE = "nginx config was rolled back on %s"
	CONFIG_ROLLBACK_FAILURE_MESSAGE = "failed to rollback nginx config on %s"

	// Types
	NGINX_EVENT_TYPE = "Nginx"
	AGENT_EVENT_TYPE = "Agent"

	// Categories
	STATUS_CATEGORY      = "Status"
	CONFIG_CATEGORY      = "Config"
	APP_PROTECT_CATEGORY = "AppProtect"

	// Event Levels
	INFO_EVENT_LEVEL     = "INFO"
	DEBUG_EVENT_LEVEL    = "DEBUG"
	WARN_EVENT_LEVEL     = "WARN"
	ERROR_EVENT_LEVEL    = "ERROR"
	CRITICAL_EVENT_LEVEL = "CRITICAL"
)
View Source
const (
	Create = fsnotify.Create
	Write  = fsnotify.Write
	Remove = fsnotify.Remove
	Rename = fsnotify.Rename
	Chmod  = fsnotify.Chmod
)
View Source
const (
	Duration        = 2 * time.Second
	InitialInterval = 100 * time.Millisecond
	MaxInterval     = 500 * time.Millisecond
	MaxTimeout      = 10 * time.Second
)
View Source
const (
	DEFAULT_PLUGIN_SIZE = 100
)

Variables

This section is empty.

Functions

func CheckAdvancedMetricsDefaults added in v2.20.0

func CheckAdvancedMetricsDefaults(cfg *advanced_metrics.Config)

func GenerateAgentStopEventCommand

func GenerateAgentStopEventCommand(agentEvent *AgentEventMeta, conf *config.Config, env core.Environment) *proto.Command

Types

type AdvancedMetrics

type AdvancedMetrics struct {
	// contains filtered or unexported fields
}

func NewAdvancedMetrics

func NewAdvancedMetrics(env core.Environment, conf *config.Config) *AdvancedMetrics

func (*AdvancedMetrics) Close

func (m *AdvancedMetrics) Close()

func (*AdvancedMetrics) Info

func (m *AdvancedMetrics) Info() *core.Info

func (*AdvancedMetrics) Init

func (m *AdvancedMetrics) Init(pipeline core.MessagePipeInterface)

func (*AdvancedMetrics) Process

func (*AdvancedMetrics) Process(_ *core.Message)

func (*AdvancedMetrics) Subscriptions

func (m *AdvancedMetrics) Subscriptions() []string

type AgentAPI added in v2.20.0

type AgentAPI struct {
	// contains filtered or unexported fields
}

func NewAgentAPI added in v2.20.0

func NewAgentAPI(config *config.Config, env core.Environment, nginxBinary core.NginxBinary) *AgentAPI

func (*AgentAPI) Close added in v2.20.0

func (a *AgentAPI) Close()

func (*AgentAPI) Info added in v2.20.0

func (a *AgentAPI) Info() *core.Info

func (*AgentAPI) Init added in v2.20.0

func (a *AgentAPI) Init(pipeline core.MessagePipeInterface)

func (*AgentAPI) Process added in v2.20.0

func (a *AgentAPI) Process(message *core.Message)

func (*AgentAPI) Subscriptions added in v2.20.0

func (a *AgentAPI) Subscriptions() []string

type AgentAPICommonResponse added in v2.21.0

type AgentAPICommonResponse struct {
	// Correlation ID
	// example: 6204037c-30e6-408b-8aaa-dd8219860b4b
	CorrelationId string `json:"correlation_id"`
	// Message
	// example: No NGINX instances found
	Message string `json:"message"`
}

swagger:model AgentAPICommonResponse

type AgentAPIConfigApplyRequest added in v2.21.0

type AgentAPIConfigApplyRequest struct {
	// contains filtered or unexported fields
}

type AgentAPIConfigApplyResponse added in v2.21.0

type AgentAPIConfigApplyResponse struct {
	// Correlation ID
	// example: 6204037c-30e6-408b-8aaa-dd8219860b4b
	CorrelationId string `json:"correlation_id"`
	// NGINX Instances
	NginxInstances []NginxInstanceResponse `json:"nginx_instances"`
}

swagger:model AgentAPIConfigApplyResponse

type AgentAPIConfigApplyStatusResponse added in v2.21.0

type AgentAPIConfigApplyStatusResponse struct {
	// Correlation ID
	// example: 6204037c-30e6-408b-8aaa-dd8219860b4b
	CorrelationId string `json:"correlation_id"`
	// Message
	// example: pending config apply
	Message string `json:"message"`
	// Status
	// example: PENDING
	Status string `json:"status"`
}

swagger:model AgentAPIConfigApplyStatusResponse

type AgentEventMeta

type AgentEventMeta struct {
	// contains filtered or unexported fields
}

func NewAgentEventMeta

func NewAgentEventMeta(version string, pid string) *AgentEventMeta

type Commander

type Commander struct {
	// contains filtered or unexported fields
}

Commander plugin is the receiver, dispatcher, and sender of all commands

func NewCommander

func NewCommander(cmdr client.Commander, config *config.Config) *Commander

func (*Commander) Close

func (c *Commander) Close()

func (*Commander) Info

func (c *Commander) Info() *core.Info

func (*Commander) Init

func (c *Commander) Init(pipeline core.MessagePipeInterface)

func (*Commander) Process

func (c *Commander) Process(msg *core.Message)

Process - Agent Communication => Control Plane *Command_AgentConnectRequest *Command_CmdStatus / CommandStatusResp *Command_DataplaneStatus *Command_NginxConfigResponse - upload *Command_AgentConfigRequest

func (*Commander) Subscriptions

func (c *Commander) Subscriptions() []string

type ConfigReader

type ConfigReader struct {
	// contains filtered or unexported fields
}

ConfigReader reads in configuration from the messagePipe

func NewConfigReader

func NewConfigReader(config *config.Config) *ConfigReader

func (*ConfigReader) Close

func (r *ConfigReader) Close()

func (*ConfigReader) Info

func (r *ConfigReader) Info() *core.Info

func (*ConfigReader) Init

func (r *ConfigReader) Init(pipeline core.MessagePipeInterface)

func (*ConfigReader) Process

func (r *ConfigReader) Process(msg *core.Message)

func (*ConfigReader) Subscriptions

func (r *ConfigReader) Subscriptions() []string

type ConfigRollbackResponse

type ConfigRollbackResponse struct {
	// contains filtered or unexported fields
}

type DataPlaneStatus

type DataPlaneStatus struct {
	// contains filtered or unexported fields
}

func NewDataPlaneStatus

func NewDataPlaneStatus(config *config.Config, meta *proto.Metadata, binary core.NginxBinary, env core.Environment, version string) *DataPlaneStatus

func (*DataPlaneStatus) Close

func (dps *DataPlaneStatus) Close()

func (*DataPlaneStatus) Info

func (dps *DataPlaneStatus) Info() *core.Info

func (*DataPlaneStatus) Init

func (dps *DataPlaneStatus) Init(pipeline core.MessagePipeInterface)

func (*DataPlaneStatus) Process

func (dps *DataPlaneStatus) Process(msg *core.Message)

func (*DataPlaneStatus) Subscriptions

func (dps *DataPlaneStatus) Subscriptions() []string

type Events

type Events struct {
	// contains filtered or unexported fields
}

func NewEvents

func NewEvents(conf *config.Config, env core.Environment, meta *proto.Metadata, nginxBinary core.NginxBinary) *Events

func (*Events) Close

func (a *Events) Close()

func (*Events) Info

func (a *Events) Info() *core.Info

func (*Events) Init

func (a *Events) Init(pipeline core.MessagePipeInterface)

func (*Events) Process

func (a *Events) Process(msg *core.Message)

func (*Events) Subscriptions

func (a *Events) Subscriptions() []string

type Extensions

type Extensions struct {
	// contains filtered or unexported fields
}

func NewExtensions

func NewExtensions(conf *config.Config, env core.Environment) *Extensions

func (*Extensions) Close

func (e *Extensions) Close()

func (*Extensions) Info

func (e *Extensions) Info() *core.Info

func (*Extensions) Init

func (e *Extensions) Init(pipeline core.MessagePipeInterface)

func (*Extensions) Process

func (e *Extensions) Process(msg *core.Message)

func (*Extensions) Subscriptions

func (e *Extensions) Subscriptions() []string

type FileWatchThrottle

type FileWatchThrottle struct {
	// contains filtered or unexported fields
}

func NewFileWatchThrottle

func NewFileWatchThrottle() *FileWatchThrottle

func (*FileWatchThrottle) Close

func (fwt *FileWatchThrottle) Close()

func (*FileWatchThrottle) GetStarted

func (fwt *FileWatchThrottle) GetStarted() bool

func (*FileWatchThrottle) Info

func (fwt *FileWatchThrottle) Info() *core.Info

func (*FileWatchThrottle) Init

func (fwt *FileWatchThrottle) Init(pipeline core.MessagePipeInterface)

func (*FileWatchThrottle) Process

func (fwt *FileWatchThrottle) Process(msg *core.Message)

func (*FileWatchThrottle) SetStarted

func (fwt *FileWatchThrottle) SetStarted(newValue bool)

func (*FileWatchThrottle) Subscriptions

func (fwt *FileWatchThrottle) Subscriptions() []string

type FileWatcher

type FileWatcher struct {
	// contains filtered or unexported fields
}

FileWatcher listens for data plane changes

func NewFileWatcher

func NewFileWatcher(config *config.Config, env core.Environment) *FileWatcher

func (*FileWatcher) Close

func (fw *FileWatcher) Close()

func (*FileWatcher) Info

func (fw *FileWatcher) Info() *core.Info

func (*FileWatcher) Init

func (fw *FileWatcher) Init(pipeline core.MessagePipeInterface)

func (*FileWatcher) Process

func (fw *FileWatcher) Process(message *core.Message)

func (*FileWatcher) Subscriptions

func (fw *FileWatcher) Subscriptions() []string

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(config *config.Config, env core.Environment, binary core.NginxBinary) *Metrics

func (*Metrics) Close

func (m *Metrics) Close()

func (*Metrics) Info

func (m *Metrics) Info() *core.Info

func (*Metrics) Init

func (m *Metrics) Init(pipeline core.MessagePipeInterface)

func (*Metrics) Process

func (m *Metrics) Process(msg *core.Message)

func (*Metrics) Subscriptions

func (m *Metrics) Subscriptions() []string

type MetricsSender added in v2.20.0

type MetricsSender struct {
	// contains filtered or unexported fields
}

func NewMetricsSender added in v2.20.0

func NewMetricsSender(reporter client.MetricReporter) *MetricsSender

func (*MetricsSender) Close added in v2.20.0

func (r *MetricsSender) Close()

func (*MetricsSender) Info added in v2.20.0

func (r *MetricsSender) Info() *core.Info

func (*MetricsSender) Init added in v2.20.0

func (r *MetricsSender) Init(pipeline core.MessagePipeInterface)

func (*MetricsSender) Process added in v2.20.0

func (r *MetricsSender) Process(msg *core.Message)

func (*MetricsSender) Subscriptions added in v2.20.0

func (r *MetricsSender) Subscriptions() []string

type MetricsThrottle

type MetricsThrottle struct {
	BulkSize int
	// contains filtered or unexported fields
}

func NewMetricsThrottle

func NewMetricsThrottle(conf *config.Config, env core.Environment) *MetricsThrottle

func (*MetricsThrottle) Close

func (r *MetricsThrottle) Close()

func (*MetricsThrottle) Info

func (r *MetricsThrottle) Info() *core.Info

func (*MetricsThrottle) Init

func (r *MetricsThrottle) Init(pipeline core.MessagePipeInterface)

func (*MetricsThrottle) Process

func (r *MetricsThrottle) Process(msg *core.Message)

func (*MetricsThrottle) Subscriptions

func (r *MetricsThrottle) Subscriptions() []string

type NAPMonitoring added in v2.20.0

type NAPMonitoring struct {
	// contains filtered or unexported fields
}

func NewNAPMonitoring added in v2.20.0

func NewNAPMonitoring(env core.Environment, cfg *config.Config) (*NAPMonitoring, error)

func (*NAPMonitoring) Close added in v2.20.0

func (n *NAPMonitoring) Close()

func (*NAPMonitoring) Info added in v2.20.0

func (n *NAPMonitoring) Info() *core.Info

func (*NAPMonitoring) Init added in v2.20.0

func (n *NAPMonitoring) Init(pipeline core.MessagePipeInterface)

func (*NAPMonitoring) Process added in v2.20.0

func (n *NAPMonitoring) Process(msg *core.Message)

func (*NAPMonitoring) Subscriptions added in v2.20.0

func (n *NAPMonitoring) Subscriptions() []string

type Nginx

type Nginx struct {
	// contains filtered or unexported fields
}

Nginx is the metadata of our nginx binary

func NewNginx

func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Environment, loadedConfig *config.Config) *Nginx

func (*Nginx) Close

func (n *Nginx) Close()

Close cleans up anything outstanding once the plugin ends

func (*Nginx) Info

func (n *Nginx) Info() *core.Info

Info returns the version of this plugin

func (*Nginx) Init

func (n *Nginx) Init(pipeline core.MessagePipeInterface)

Init initializes the plugin

func (*Nginx) Process

func (n *Nginx) Process(message *core.Message)

Process processes the messages from the messaging pipe

func (*Nginx) Subscriptions

func (n *Nginx) Subscriptions() []string

type NginxAppProtect

type NginxAppProtect struct {
	// contains filtered or unexported fields
}

NginxAppProtect monitors the NAP installation on the system and reports back its details

func NewNginxAppProtect

func NewNginxAppProtect(config *config.Config, env core.Environment) (*NginxAppProtect, error)

func (*NginxAppProtect) Close

func (n *NginxAppProtect) Close()

func (*NginxAppProtect) Info

func (n *NginxAppProtect) Info() *core.Info

func (*NginxAppProtect) Init

func (n *NginxAppProtect) Init(pipeline core.MessagePipeInterface)

func (*NginxAppProtect) Process

func (n *NginxAppProtect) Process(msg *core.Message)

func (*NginxAppProtect) Subscriptions

func (n *NginxAppProtect) Subscriptions() []string

type NginxConfigValidationResponse added in v2.20.0

type NginxConfigValidationResponse struct {
	// contains filtered or unexported fields
}

type NginxCounter

type NginxCounter struct {
	// contains filtered or unexported fields
}

func NewNginxCounter

func NewNginxCounter(conf *config.Config, nginxBinary core.NginxBinary, env core.Environment) *NginxCounter

func (*NginxCounter) Close

func (nc *NginxCounter) Close()

func (*NginxCounter) Info

func (nc *NginxCounter) Info() *core.Info

func (*NginxCounter) Init

func (nc *NginxCounter) Init(pipeline core.MessagePipeInterface)

func (*NginxCounter) Process

func (nc *NginxCounter) Process(msg *core.Message)

func (*NginxCounter) Subscriptions

func (nc *NginxCounter) Subscriptions() []string

type NginxHandler added in v2.20.0

type NginxHandler struct {
	// contains filtered or unexported fields
}

func (*NginxHandler) ServeHTTP added in v2.20.0

func (h *NginxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NginxInstanceResponse added in v2.21.0

type NginxInstanceResponse struct {
	// NGINX ID
	// example: b636d4376dea15405589692d3c5d3869ff3a9b26b0e7bb4bb1aa7e658ace1437
	NginxId string `json:"nginx_id"`
	// Message
	// example: config applied successfully
	Message string `json:"message"`
	// Status
	// example: OK
	Status string `json:"status"`
}

swagger:model NginxInstanceResponse

type NginxReloadResponse

type NginxReloadResponse struct {
	// contains filtered or unexported fields
}

type OneTimeRegistration

type OneTimeRegistration struct {
	// contains filtered or unexported fields
}

func NewOneTimeRegistration

func NewOneTimeRegistration(
	config *config.Config,
	binary core.NginxBinary,
	env core.Environment,
	meta *proto.Metadata,
	version string,
) *OneTimeRegistration

func (*OneTimeRegistration) Close

func (r *OneTimeRegistration) Close()

func (*OneTimeRegistration) Info

func (r *OneTimeRegistration) Info() *core.Info

func (*OneTimeRegistration) Init

func (r *OneTimeRegistration) Init(pipeline core.MessagePipeInterface)

func (*OneTimeRegistration) Process

func (r *OneTimeRegistration) Process(msg *core.Message)

func (*OneTimeRegistration) Subscriptions

func (r *OneTimeRegistration) Subscriptions() []string

type ParameterRequest added in v2.22.0

type ParameterRequest struct {
	// in: formData
	// swagger:file
	File interface{} `json:"file"`
}

swagger:parameters apply-nginx-config

type Payload

type Payload struct {
	LastUpdated int64 `json:",string"`
}

type ProcessWatcher

type ProcessWatcher struct {
	// contains filtered or unexported fields
}

ProcessWatcher listens for changes to nginx processes on the data plane

func NewProcessWatcher

func NewProcessWatcher(env core.Environment, nginxBinary core.NginxBinary) *ProcessWatcher

func (*ProcessWatcher) Close

func (pw *ProcessWatcher) Close()

func (*ProcessWatcher) Info

func (pw *ProcessWatcher) Info() *core.Info

func (*ProcessWatcher) Init

func (pw *ProcessWatcher) Init(pipeline core.MessagePipeInterface)

func (*ProcessWatcher) Process

func (pw *ProcessWatcher) Process(message *core.Message)

func (*ProcessWatcher) Subscriptions

func (pw *ProcessWatcher) Subscriptions() []string

Jump to

Keyboard shortcuts

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