nginx

package
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: 12 Imported by: 0

Documentation

Overview

nginx package tracks configurations allowed and enabled

Index

Constants

View Source
const (
	DefaultLabel = "nginx"
)

Variables

This section is empty.

Functions

func NewWithConfig

func NewWithConfig(c Config) (Task, error)

Types

type Config

type Config struct {
	Label_    string `hcl:"label,label" json:"label,omitempty"`            // Label for the configuration
	Path      string `hcl:"conf_path" json:"conf_path"`                    // Root path for the configuration
	PidPath   string `hcl:"pid_path,optional" json:"pid_path"`             // Path to the PID file
	Available string `hcl:"available_path,optional" json:"available_path"` // Path to available sites, under root
	Recursive bool   `hcl:"available_recursive,optional" json:"recursive"` // Recursively search in available folder
	Enabled   string `hcl:"enabled_path,optional" json:"enabled_path"`     // Path to enabled sites, under root
}

func (Config) Label

func (c Config) Label() string

func (Config) Name

func (c Config) Name() string

func (Config) New

func (c Config) New(ctx context.Context, provider Provider) (Task, error)

Return a new task. Label for the task can be retrieved from context

type File

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

func CreateFile

func CreateFile(path string, data []byte) (*File, error)

func NewFile

func NewFile(path string, info fs.FileInfo) *File

func (*File) Disable

func (f *File) Disable() error

Disable an enabled configuration

func (*File) Enabled

func (f *File) Enabled() bool

Return true if the configuration is enabled

func (*File) Name

func (f *File) Name() string

Return the name of the configuration

func (*File) Path

func (f *File) Path() string

Return the path for the configuration

func (*File) Read

func (f *File) Read() ([]byte, error)

Read the configuration file

func (*File) Revoke

func (f *File) Revoke() error

Delete the file

func (*File) SetEnabled

func (f *File) SetEnabled(path string)

Set the enabled path

func (*File) String

func (f *File) String() string

type Folder

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

Folder tracks files within a folder

func NewFolder

func NewFolder(path string, recursive bool) (*Folder, error)

func (*Folder) Enumerate

func (f *Folder) Enumerate() ([]*File, error)

func (*Folder) RelPath

func (f *Folder) RelPath(root string) string

func (*Folder) String

func (f *Folder) String() string

Jump to

Keyboard shortcuts

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