nginxgw

package module
v0.0.0-...-4685c53 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

terraform-provider-nginx

DRAFT

A terraform provider to manage nginx configuration. Exposes an API for performing the following:

  • Enumerating a list of configuration files
  • Enabling and disabling configuration files
  • Testing nginx configuration
  • Reloading nginx configuration

There are two elements to the provider:

  • An API gateway which manages the nginx configuration files and server, and listens for requests from the terraform provider. This server can be run in a docker container, more details are below.
  • A terraform provider which exposes the API gateway as a resource.

Server API

The server task provides a REST API for creating, removing, limking and unlinking configurations. The schema for the API is as follows:

Method Path Pattern Body Description
GET / No body Returns the list of available configurations
GET /:name No body Returns a configuration
POST /:name { "enabled" : <bool>, "body" : <text> } Creates a new configuration
DELETE /:name No body Removes a configuration
PATCH /:name { "enabled" : <bool> } Enables or disables a configuration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Key() any
	Value() any
	Error() error

	// Event can be emitted to a channel. Returns false if unable to do so
	Emit(chan<- Event) bool
}

Event will emit key/value pairs or errors emited on a channel

type Provider

type Provider interface {
	Task

	// Create a new task
	New(ctx context.Context, config TaskPlugin) (Task, error)
}

Provider runs many tasks simultaneously

type Task

type Task interface {
	// Run is called to start the task and block until context is cancelled
	Run(context.Context) error

	// Sub returns a channel on which events can be received, or returns nil
	// if the task does not emit events
	Sub() <-chan Event

	// Unsub is called to unsubscribe from an existing events channel
	Unsub(<-chan Event)
}

Task runs a single task, whilst emitting events

type TaskPlugin

type TaskPlugin interface {
	Name() string  // Return the name of the task
	Label() string // Return the label of the task

	// Return a new task. Label for the task can be retrieved from context
	New(context.Context, Provider) (Task, error)
}

TaskPlugin provides methods to register a Task

Directories

Path Synopsis
cmd
pkg
config
Package config parses configuration files
Package config parses configuration files
event
Package `event` provides events and subscriptions.
Package `event` provides events and subscriptions.
fcgi
Package fcgi implements the FastCGI protocol.
Package fcgi implements the FastCGI protocol.
hcl
hcl is a package to read HCL configuration files
hcl is a package to read HCL configuration files
httpserver
httpserver package provides HTTP, HTTPS and FastCGI servers
httpserver package provides HTTP, HTTPS and FastCGI servers
mdns
The mdns package listens and broadcasts for DNS packets
The mdns package listens and broadcasts for DNS packets
mdns-discovery
mdns-discovery package parses DNS packets and emits discovery events
mdns-discovery package parses DNS packets and emits discovery events
mdns-gateway
mdns-gateway package is an API for discovered network services
mdns-gateway package is an API for discovered network services
nginx
nginx package tracks configurations allowed and enabled
nginx package tracks configurations allowed and enabled
plugin
plugin package loads plugins and provides other plugin services
plugin package loads plugins and provides other plugin services
provider
Package provider co-ordinates tasks and events for the lifecycle of the application.
Package provider co-ordinates tasks and events for the lifecycle of the application.
router
router package provides a way to route HTTP paths to HTTP handlers
router package provides a way to route HTTP paths to HTTP handlers
tokenauth
tokenauth package manages the authentication tokens
tokenauth package manages the authentication tokens
tokenauth-gateway
tokenauth_gateway plugin is a gateway for token authentication.
tokenauth_gateway plugin is a gateway for token authentication.
types
types package implements duration time
types package implements duration time

Jump to

Keyboard shortcuts

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