nginx

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*option)

Option defines a functional option for configuring settings.

func WithParameter

func WithParameter(name, value string) Option

WithParameter adds a parameter to replace in the template.

func WithTemplate

func WithTemplate(template string) Option

WithTemplate sets the template string for the nginx server configuration.

type ReverseProxy

type ReverseProxy interface {
	// Exists returns whether the site configuration exists.
	Exists() (bool, error)

	// Enabled returns whether the site exists and is currently enabled.
	Enabled() (bool, error)

	// Disable disables the site.
	Disable() error

	// Enable enables the site.
	Enable() error

	// Install sets up the site configuration.
	// If override is false and the site already exists, it returns false.
	Install(override bool) (bool, error)

	// Uninstall removes the site configuration.
	Uninstall() error
}

ReverseProxy represents a NGINX reverse proxy manager.

func NewReverseProxy

func NewReverseProxy(name, port string, domains []string, options ...Option) ReverseProxy

NewReverseProxy creates a new ReverseProxy instance with the given name, port, domains and options.

type ServerBlock

type ServerBlock interface {
	// Exists returns whether the site configuration exists.
	Exists() (bool, error)

	// Enabled returns whether the site exists and is currently enabled.
	Enabled() (bool, error)

	// Disable disables the site.
	Disable() error

	// Enable enables the site.
	Enable() error

	// Install sets up the site configuration.
	// If override is false and the site already exists, it returns false.
	Install(override bool) (bool, error)

	// Uninstall removes the site configuration.
	Uninstall() error
}

ServerBlock represents a NGINX server block manager.

func NewServerBlock

func NewServerBlock(name, template string, options ...Option) ServerBlock

NewServerBlock creates a new ServerBlock instance with the given name, template and options.

Jump to

Keyboard shortcuts

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