Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Listeners []ListenerConfig `json:"listeners" yaml:"listeners"` Connect ConnectConfig `json:"connect" yaml:"connect"` Server ServerConfig `json:"server" yaml:"server"` Log log.Config `json:"log" yaml:"log"` // GracePeriod is the duration to gracefully shutdown the agent. During // the grace period, listeners and idle connections are closed, then waits // for active requests to complete and closes their connections. GracePeriod time.Duration `json:"grace_period" yaml:"grace_period"` }
func (*Config) RegisterFlags ¶
type ConnectConfig ¶ added in v0.3.0
type ConnectConfig struct { // URL is the Piko server URL to connect to. URL string // Token is a token to authenticate with the Piko server. Token string // Timeout is the timeout attempting to connect to the Piko server on // boot. Timeout time.Duration `json:"timeout" yaml:"timeout"` TLS TLSConfig `json:"tls" yaml:"tls"` }
func (*ConnectConfig) RegisterFlags ¶ added in v0.3.0
func (c *ConnectConfig) RegisterFlags(fs *pflag.FlagSet)
func (*ConnectConfig) Validate ¶ added in v0.3.0
func (c *ConnectConfig) Validate() error
type ListenerConfig ¶ added in v0.3.0
type ListenerConfig struct { // EndpointID is the endpoint ID to register. EndpointID string `json:"endpoint_id" yaml:"endpoint_id"` // Addr is the address of the upstream service to forward to. Addr string `json:"addr" yaml:"addr"` // Protocol is the protocol to listen on. Supports "http" and "tcp". // Defaults to "http". Protocol ListenerProtocol `json:"protocol" yaml:"protocol"` // AccessLog indicates whether to log all incoming connections and requests // for the endpoint. AccessLog bool `json:"access_log" yaml:"access_log"` // Timeout is the timeout to forward incoming requests to the upstream. Timeout time.Duration `json:"timeout" yaml:"timeout"` // TLS configures the client TLS config when connecting to the upstream // service. // // Note the client can only use TLS when connecting to the upstream with // HTTPS. TLS TLSConfig `json:"tls" yaml:"tls"` }
func (*ListenerConfig) Host ¶ added in v0.5.0
func (c *ListenerConfig) Host() (string, bool)
Host parses the given upstream address into a host and port. Return false if the address is invalid.
The addr may be either a a host and port or just a port.
func (*ListenerConfig) URL ¶ added in v0.3.0
func (c *ListenerConfig) URL() (*url.URL, bool)
URL parses the given upstream address into a URL. Return false if the address is invalid.
The addr may be either a full URL, a host and port or just a port.
func (*ListenerConfig) Validate ¶ added in v0.3.0
func (c *ListenerConfig) Validate() error
type ListenerProtocol ¶ added in v0.5.0
type ListenerProtocol string
const ( ListenerProtocolHTTP ListenerProtocol = "http" ListenerProtocolTCP ListenerProtocol = "tcp" )
type ServerConfig ¶
type ServerConfig struct { // Enabled indicates whether to enable the agent metrics server. Enabled bool `json:"enabled" yaml:"enabled"` // BindAddr is the address to bind to listen for incoming HTTP connections. BindAddr string `json:"bind_addr" yaml:"bind_addr"` }
func (*ServerConfig) RegisterFlags ¶ added in v0.2.0
func (c *ServerConfig) RegisterFlags(fs *pflag.FlagSet)
func (*ServerConfig) Validate ¶
func (c *ServerConfig) Validate() error
type TLSConfig ¶ added in v0.3.0
type TLSConfig struct { // Cert contains a path to the PEM encoded certificate to present to // the server (optional). Cert string `json:"cert" yaml:"cert"` // Key contains a path to the PEM encoded private key (optional). Key string `json:"key" yaml:"key"` // RootCAs contains a path to root certificate authorities to validate // the TLS connection to the Piko server. // // Defaults to using the host root CAs. RootCAs string `json:"root_cas" yaml:"root_cas"` // InsecureSkipVerify configures the agent to accept any certificate // presented by the server and any host name in that certificate. // // See https://pkg.go.dev/crypto/tls#Config. InsecureSkipVerify bool `json:"insecure_skip_verify" yaml:"insecure_skip_verify"` }
func (*TLSConfig) RegisterFlags ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.