caddy

package
v2.2.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: AGPL-3.0 Imports: 31 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FuncMap = template.FuncMap{
		"urls":           internalURLFromServices,
		"serviceAddress": addressFromService,
	}

	LastKnownCaddyFile string
)
View Source
var (
	DefaultCaUrl        = "https://acme-v02.api.letsencrypt.org/directory"
	DefaultCaStagingUrl = "https://acme-staging-v02.api.letsencrypt.org/directory"
)

Functions

func Enable

func Enable(caddyfile string, player TemplateFunc)

Enable the caddy builder

func GetConfigPaths added in v1.5.0

func GetConfigPaths() [][]string

func GetInstance

func GetInstance() *caddy.Instance

func GetMaintenanceRoot

func GetMaintenanceRoot() (string, error)

func GetPathes

func GetPathes() []string

func RegisterPluginTemplate

func RegisterPluginTemplate(fn TemplateFunc, watchConfigPath []string, pathes ...string) error

RegisterPluginTemplate adds a TemplateFunc to be called for each plugin

func Restart

func Restart() error

func ServiceReady

func ServiceReady(name string) bool

func Start

func Start() error

func StartWithFastRestart added in v1.4.1

func StartWithFastRestart() (chan bool, error)

func Stop added in v1.4.1

func Stop() error

Types

type Caddy

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

Caddy contains the templates and functions for building a dynamic caddyfile

func Get

func Get() *Caddy

Get returns the currently enabled caddy builder

func (*Caddy) GetTemplate

func (c *Caddy) GetTemplate() *template.Template

func (*Caddy) Play

func (c *Caddy) Play() (*bytes.Buffer, error)

type SiteConf

type SiteConf struct {
	*install.ProxyConfig
	// Parsed values from proto oneOf
	TLS     string
	TLSCert string
	TLSKey  string
	// Parsed External host if any
	ExternalHost string
	// Custom Root for this site
	WebRoot string
}

func SiteConfFromProxyConfig

func SiteConfFromProxyConfig(pc *install.ProxyConfig) (SiteConf, error)

func SitesToCaddyConfigs

func SitesToCaddyConfigs(sites []*install.ProxyConfig) (caddySites []SiteConf, er error)

func (SiteConf) Redirects

func (s SiteConf) Redirects() map[string]string

type TemplateFunc

type TemplateFunc func(site ...SiteConf) (*bytes.Buffer, error)

TemplateFunc is a function providing a stringer

func GetTemplates

func GetTemplates() []TemplateFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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