webserver

package
v0.5.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigData

type ConfigData map[string][]byte

ConfigData is a map of each configuration file and its content

type NginxConfig

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

NginxConfig creates the configuration for nginx

var Instance *NginxConfig

Instance is a singleton for NginxConfig

func (*NginxConfig) ConfigTest

func (n *NginxConfig) ConfigTest() (bool, error)

ConfigTest runs the Nginx's config test command and returns whether the configuration is valid

func (*NginxConfig) DesiredConfiguration

func (n *NginxConfig) DesiredConfiguration(sites []state.SiteState) (config ConfigData, err error)

DesiredConfiguration builds the list of files for the desired configuration for nginx

func (*NginxConfig) EnsureServerRunning

func (n *NginxConfig) EnsureServerRunning() error

EnsureServerRunning starts the Nginx server if it's not running already

func (*NginxConfig) ExistingConfiguration

func (n *NginxConfig) ExistingConfiguration(sites []state.SiteState) (ConfigData, bool, error)

ExistingConfiguration reads the list of files currently on disk, and deletes some extraneous ones already

func (*NginxConfig) Init

func (n *NginxConfig) Init() error

Init initializes the object and loads the templates from file

func (*NginxConfig) RestartServer

func (n *NginxConfig) RestartServer() error

RestartServer restarts the Nginx server

func (*NginxConfig) Status

func (n *NginxConfig) Status() (bool, error)

Status returns the status of the Nginx server

func (*NginxConfig) SyncConfiguration

func (n *NginxConfig) SyncConfiguration(sites []state.SiteState) (bool, error)

SyncConfiguration ensures that the configuration for the webserver matches the desired state

Jump to

Keyboard shortcuts

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