Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultReloadPort is the default port that the Reload endpoint will listen on DefaultPort = 8484 // DefaultReloadAddress is the default address that the Reload endpoint will listen on DefaultAddress = "127.0.0.1" // DefaultConfigHandlerPath is the default value for the Trickster Config Printout Handler path DefaultConfigHandlerPath = "/trickster/config" // DefaultPingHandlerPath is the default value for the Trickster Config Ping Handler path DefaultPingHandlerPath = "/trickster/ping" // DefaultHealthHandlerPath defines the default path for the Health Handler DefaultHealthHandlerPath = "/trickster/health" // DefaultPurgeByKeyHandlerPath defines the default path for the Cache Purge (by Key) Handler DefaultPurgeByKeyHandlerPath = "/trickster/purge/key/" // DefaultPurgeByPathHandlerPath defines the default path for the Cache Purge (by Path) Handler DefaultPurgeByPathHandlerPath = "/trickster/purge/path/" // DefaultPprofServerName defines the default Pprof Server Name DefaultPprofServerName = "both" // DefaultDrainTimeout is the default time that is allowed for an old configuration's requests to drain // before its resources are closed DefaultDrainTimeout = 30 * time.Second // DefaultRateLimit is the default Rate Limit time for Config Reloads DefaultRateLimit = 3 * time.Second // DefaultReloadHandlerPath defines the default path for the Reload Handler DefaultReloadHandlerPath = "/trickster/config/reload" )
Variables ¶
View Source
var ErrInvalidPprofServerName = errors.New("invalid pprof server name")
ErrInvalidPprofServerName returns an error for invalid pprof server name
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// ListenAddress is IP address from which the Reload API is available at ReloadHandlerPath
ListenAddress string `yaml:"listen_address,omitempty"`
// ListenPort is TCP Port from which the Reload API is available at ReloadHandlerPath
ListenPort int `yaml:"listen_port,omitempty"`
// ConfigHandlerPath provides the path to register the Config Handler for outputting the running configuration
ConfigHandlerPath string `yaml:"config_handler_path,omitempty"`
// PingHandlerPath provides the path to register the Ping Handler for checking that Trickster is running
PingHandlerPath string `yaml:"ping_handler_path,omitempty"`
// HealthHandlerPath provides the base Health Check Handler path
HealthHandlerPath string `yaml:"health_handler_path,omitempty"`
// PurgeByKeyHandlerPath provides the base Cache Purge-by-Key Handler path
PurgeByKeyHandlerPath string `yaml:"purge_by_key_path,omitempty"`
// PurgeByKeyHandlerPath provides the base Cache Purge-by-Path Handler path
PurgeByPathHandlerPath string `yaml:"purge_by_path_path,omitempty"`
// PprofServer provides the name of the http listener that will host the pprof debugging routes
// Options are: "metrics", "mgmt", "both", or "off"; default is both
PprofServer string `yaml:"pprof_server,omitempty"`
//
// ReloadHandlerPath provides the path to register the Config Reload Handler
ReloadHandlerPath string `yaml:"handler_path,omitempty"`
// ReloadDrainTimeout provides the duration to wait for all sessions to drain before closing
// old resources following a reload
ReloadDrainTimeout time.Duration `yaml:"drain_timeout,omitempty"`
// ReloadRateLimit limits the # of handled config reload HTTP requests to 1 per CheckRateMS
// if multiple HTTP requests are received in the rate limit window, only the first is handled
// This prevents a bad actor from stating the config file with millions of concurrent requests
// The rate limit does not apply to SIGHUP-based reload requests
ReloadRateLimit time.Duration `yaml:"rate_limit,omitempty"`
}
Options is a collection of configurations for trickster management features
Click to show internal directories.
Click to hide internal directories.