diff --git a/agent/proxy/daemon.go b/agent/proxy/daemon.go new file mode 100644 index 0000000000..f432271b6d --- /dev/null +++ b/agent/proxy/daemon.go @@ -0,0 +1,24 @@ +package proxy + +import ( + "os/exec" +) + +// Daemon is a long-running proxy process. It is expected to keep running +// and to use blocking queries to detect changes in configuration, certs, +// and more. +// +// Consul will ensure that if the daemon crashes, that it is restarted. +type Daemon struct { + // Command is the command to execute to start this daemon. This must + // be a Cmd that isn't yet started. + Command *exec.Cmd + + // ProxyToken is the special local-only ACL token that allows a proxy + // to communicate to the Connect-specific endpoints. + ProxyToken string +} + +// Start starts the daemon and keeps it running. +func (p *Daemon) Start() error { +} diff --git a/agent/proxy/manager.go b/agent/proxy/manager.go new file mode 100644 index 0000000000..943b369ffe --- /dev/null +++ b/agent/proxy/manager.go @@ -0,0 +1 @@ +package proxy diff --git a/agent/proxy/proxy.go b/agent/proxy/proxy.go new file mode 100644 index 0000000000..d42ec3903a --- /dev/null +++ b/agent/proxy/proxy.go @@ -0,0 +1,12 @@ +// Package proxy contains logic for agent interaction with proxies, +// primarily "managed" proxies. Managed proxies are proxy processes for +// Connect-compatible endpoints that Consul owns and controls the lifecycle +// for. +// +// This package does not contain the built-in proxy for Connect. The source +// for that is available in the "connect/proxy" package. +package proxy + +// EnvProxyToken is the name of the environment variable that is passed +// to managed proxies containing the proxy token. +const EnvProxyToken = "CONNECT_PROXY_TOKEN"