Documentation ¶
Index ¶
- Constants
- Variables
- func ExecuteTemplate(templateName string, t string, params any) (applied []byte, err error)
- func ExtractCaddyMajorVersionStr(versionInfo string) (majorVersion string)
- func GetExecVersion(cfg *Config) (majorVersion int, err error)
- type API
- type APIReverseProxySettings
- type BaseConfig
- type Config
- func (c *Config) APIReverseProxyEnabled() (enabled bool)
- func (c *Config) GetBaseConf(bc *BaseConfig) (text []byte, err error)
- func (c *Config) GetRandomSubdomain() (subdomain string, err error)
- func (c *Config) MakeBaseConfFilename() (filename string)
- func (c *Config) MakeBaseConfig(targetAPIPort string) (bc *BaseConfig, err error)
- func (c *Config) ParseAndValidate(serverDataDir string, serverLogLevel string, filesAPI files.FileAPI) error
- type DefaultVirtualHost
- type ExternalReverseProxy
- type GlobalSettings
- type NewRouteRequest
- type Server
- func (s *Server) AddRoute(ctx context.Context, nrr *NewRouteRequest) (res *http.Response, err error)
- func (c *Server) Close() (err error)
- func (s *Server) DeleteRoute(ctx context.Context, routeID string) (res *http.Response, err error)
- func (c *Server) Run()
- func (c *Server) Start(ctx context.Context) (err error)
- func (c *Server) Wait() (err error)
- type SubdomainGenerator
Constants ¶
View Source
const DefaultAlphabet = "0123456789abcdefghijklmnopqrstuvwxyz"
View Source
const (
NewRoutePath = "/config/apps/http/servers/srv0/routes/0"
)
Variables ¶
View Source
var ( ErrCaddyExecPathMissing = errors.New("caddy executable path missing") ErrCaddyExecNotFound = errors.New("caddy executable not found") ErrCaddyFailedCheckingExecPath = errors.New("failed checking caddy exec path") ErrCaddyUnableToGetCaddyServerVersion = errors.New("failed getting caddy server version") ErrCaddyServerExecutableTooOld = errors.New("caddy server version too old. please use v2 or later") ErrCaddyTunnelsHostAddressMissing = errors.New("caddy tunnels address missing") ErrCaddyTunnelsBaseDomainMissing = errors.New("caddy tunnels subdomain prefix missing") ErrCaddyTunnelsWildcardCertFileMissing = errors.New("caddy tunnels wildcard domains cert file missing") ErrCaddyTunnelsWildcardKeyFileMissing = errors.New("caddy tunnels wildcard domains key file missing") ErrCaddyUnknownLogLevel = errors.New("rport log level not a known caddy log level") ErrCaddyMissingAPIPort = errors.New("when api_hostname specified then api_port must also be set") ErrCaddyMissingAPIHostname = errors.New("when api_port specified then api_hostname must also be set") ErrUnableToGetAddressAndPortFromHostAddress = errors.New("unable to get ip address and port from caddy address. please make sure both are set") ErrUnableToCheckIfCertFileExists = errors.New("unable to check if caddy cert file exists") ErrCaddyCertFileNotFound = errors.New("caddy cert file not found") ErrUnableToCheckIfKeyFileExists = errors.New("unable to check if caddy key file exists") ErrCaddyKeyFileNotFound = errors.New("caddy key file not found") ErrUnableToCheckIfAPICertFileExists = errors.New("unable to check if caddy api cert file exists") ErrCaddyAPICertFileNotFound = errors.New("caddy api cert file not found") ErrUnableToCheckIfAPIKeyFileExists = errors.New("unable to check if caddy api cert file exists") ErrCaddyAPIKeyFileNotFound = errors.New("caddy api key file not found") ErrCaddyUnknownTLSMin = errors.New("tls_min not a known tls protocol version") )
View Source
var (
HostDomainSocket = "//tmp/caddy-admin.sock"
)
View Source
var NewRouteRequestTemplate string
Functions ¶
func ExecuteTemplate ¶
func GetExecVersion ¶
Types ¶
type APIReverseProxySettings ¶
type BaseConfig ¶
type BaseConfig struct { IncludeAPIProxy bool GlobalSettings *GlobalSettings DefaultVirtualHost *DefaultVirtualHost APIReverseProxySettings *APIReverseProxySettings }
type Config ¶
type Config struct { ExecPath string `mapstructure:"caddy"` HostAddress string `mapstructure:"address"` BaseDomain string `mapstructure:"subdomain_prefix"` CertFile string `mapstructure:"cert_file"` KeyFile string `mapstructure:"key_file"` APIHostname string `mapstructure:"api_hostname"` APIPort string `mapstructure:"api_port"` APICertFile string `mapstructure:"api_cert_file"` APIKeyFile string `mapstructure:"api_key_file"` TLSMin string `mapstructure:"tls_min"` LogLevel string `mapstructure:"-"` // taken from the rport server log level DataDir string `mapstructure:"-"` // taken from the rport server datadir BaseConfFilename string `mapstructure:"-"` Enabled bool `mapstructure:"-"` SubDomainGenerator SubdomainGenerator }
func (*Config) APIReverseProxyEnabled ¶
func (*Config) GetBaseConf ¶
func (c *Config) GetBaseConf(bc *BaseConfig) (text []byte, err error)
func (*Config) GetRandomSubdomain ¶
func (*Config) MakeBaseConfFilename ¶
func (*Config) MakeBaseConfig ¶
func (c *Config) MakeBaseConfig(targetAPIPort string) (bc *BaseConfig, err error)
type DefaultVirtualHost ¶
type ExternalReverseProxy ¶
type GlobalSettings ¶
type NewRouteRequest ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) DeleteRoute ¶
type SubdomainGenerator ¶
Click to show internal directories.
Click to hide internal directories.