plugins

package
v2.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Host: localhost:8081 swagger:meta

Index

Constants

View Source
const (
	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"
)
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
	MaxElapsedTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

func LoadPlugins added in v2.29.0

func LoadPlugins(commander client.Commander, binary core.NginxBinary, env core.Environment, reporter client.MetricReporter, loadedConfig *config.Config, agentEventsMeta *events.AgentEventMeta) ([]core.Plugin, []core.ExtensionPlugin)

Types

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, processes []*core.Process) *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 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 *Command_AgentConfig

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, processes []*core.Process) *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, agentEventsMeta *events.AgentEventMeta) *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 Features added in v2.26.0

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

func NewFeatures added in v2.26.0

func NewFeatures(
	commander client.Commander,
	conf *config.Config,
	env core.Environment,
	binary core.NginxBinary,
	version string,
	processes []*core.Process,
	agentEventsMeta *events.AgentEventMeta,
) *Features

func (*Features) Close added in v2.26.0

func (f *Features) Close()

func (*Features) Info added in v2.26.0

func (f *Features) Info() *core.Info

func (*Features) Init added in v2.26.0

func (f *Features) Init(pipeline core.MessagePipeInterface)

func (*Features) Process added in v2.26.0

func (f *Features) Process(msg *core.Message)

func (*Features) Subscriptions added in v2.26.0

func (f *Features) 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, processes []*core.Process) *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 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, processes []*core.Process) *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

func (*Nginx) ValidateNginxAppProtectVersion added in v2.24.0

func (n *Nginx) ValidateNginxAppProtectVersion(nginxConfig *proto.NginxConfig) (bool, error)

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,
	processes []*core.Process,
) *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, processes []*core.Process) *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