Documentation ¶
Overview ¶
Package proxy contains the implementation of the oauthproxy service.
Index ¶
Constants ¶
View Source
const ( // CacheTTLMinValue is the smallest time permitted by the service for cached tokens. CacheTTLMinValue = 10 * time.Minute // RequestTimeoutMinValue is the smallest time permitted for request timeouts to down stream systems. RequestTimeoutMinValue = 10 * time.Second // ShutdownGracePeriodMinValue is the smallest period of time the service can be configured to wait for a graceful exit. ShutdownGracePeriodMinValue = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Settings ¶
type Settings struct { // CacheTTL how long a item remains valid in the cache CacheTTL time.Duration // RequestTimeout timeout period for a down sstream request RequestTimeout time.Duration // ShutdownGracePeriod how long to wait for shutdown ShutdownGracePeriod time.Duration // HTTPListenAddr address and port to listen on HTTPListenAddr string // Downstream endpoint Endpoint string // Logger recices bogging messages from the service Logger LoggerFunc // PoolSize is the number of go routines servicing downstream requests PoolSize int }
Settings contains the proxy services settings.
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings returns the default settings for the service.
func (Settings) WithEndpoint ¶
WithEndpoint sets the down stream oauth services endpoint, the request path is appended to this setting.
func (Settings) WithHTTPPort ¶
WithHTTPPort creates a new settings with the HTTP port set to the passed value.
func (Settings) WithLogger ¶
func (settings Settings) WithLogger(logger LoggerFunc) Settings
WithLogger creates anew settings with the passed logger function used for logging.
Click to show internal directories.
Click to hide internal directories.