Documentation ¶
Overview ¶
nolint: lll
Index ¶
- Constants
- func GetFromRemote(cfg *config.Params, c *sysC.ThreeScaleClient, report reportMetrics) (sysC.ProxyConfigElement, error)
- type AdapterConfig
- type ProxyConfigCache
- func (pc *ProxyConfigCache) FlushCache()
- func (pc *ProxyConfigCache) Get(cfg *config.Params, c *sysC.ThreeScaleClient) (sysC.ProxyConfigElement, error)
- func (pc *ProxyConfigCache) StartFlushWorker() error
- func (pc *ProxyConfigCache) StartRefreshWorker() error
- func (pc *ProxyConfigCache) StopFlushWorker() error
- func (pc *ProxyConfigCache) StopRefreshWorker() error
- type Server
- type Threescale
Constants ¶
const ( // DefaultCacheTTL - Default time to wait before purging expired items from the cache DefaultCacheTTL = time.Duration(time.Minute * 5) // DefaultCacheRefreshBuffer - Default time difference to refresh the cache element before expiry time DefaultCacheRefreshBuffer = time.Duration(time.Minute * 3) // DefaultCacheLimit - Default max number of items that can be stored in the cache at any time DefaultCacheLimit = 1000 // DefaultCacheUpdateRetries - Default number of additional attempts made to update cached entries for unreachable hosts DefaultCacheUpdateRetries = 1 )
const ( // consts reflect key values in instance config AppIDAttributeKey = "app_id" AppKeyAttributeKey = "app_key" OIDCAttributeKey = "client_id" )
Variables ¶
This section is empty.
Functions ¶
func GetFromRemote ¶ added in v0.7.0
func GetFromRemote(cfg *config.Params, c *sysC.ThreeScaleClient, report reportMetrics) (sysC.ProxyConfigElement, error)
GetFromRemote is used to fetch the proxy config from 3scale using the client
Types ¶
type AdapterConfig ¶
type AdapterConfig struct {
// contains filtered or unexported fields
}
AdapterConfig wraps optional configuration for the 3scale adapter
func NewAdapterConfig ¶
func NewAdapterConfig(cache *ProxyConfigCache, metrics *prometheus.Reporter, grpcKeepalive time.Duration) *AdapterConfig
NewAdapterConfig - Creates configuration for Threescale adapter
type ProxyConfigCache ¶
type ProxyConfigCache struct {
// contains filtered or unexported fields
}
ProxyConfigCache provides a mechanism to enable caching of calls to 3scale system
func NewProxyConfigCache ¶
func NewProxyConfigCache(cacheTTL time.Duration, refreshBuffer time.Duration, refreshRetries int, limit int) *ProxyConfigCache
NewProxyConfigCache returns a ProxyConfigCache The accepted parameters are cacheTTL - the time between when an entry is added to the cache and when it should expire, and limit - the total number of entries that can be stored in the cache at any given time.
func (*ProxyConfigCache) FlushCache ¶
func (pc *ProxyConfigCache) FlushCache()
FlushCache iterates over the items in the cache and purges any expired items
func (*ProxyConfigCache) Get ¶ added in v0.7.0
func (pc *ProxyConfigCache) Get(cfg *config.Params, c *sysC.ThreeScaleClient) (sysC.ProxyConfigElement, error)
Get returns a proxyConfig for a given ThreescaleClient, either from the local Cache or fetching it remotely
func (*ProxyConfigCache) StartFlushWorker ¶
func (pc *ProxyConfigCache) StartFlushWorker() error
StartFlushWorker starts a background process that periodically carries out the functionality provided by FlushCache
func (*ProxyConfigCache) StartRefreshWorker ¶
func (pc *ProxyConfigCache) StartRefreshWorker() error
StartRefreshWorker starts a background process that periodically carries out the functionality provided by refreshCache
func (*ProxyConfigCache) StopFlushWorker ¶
func (pc *ProxyConfigCache) StopFlushWorker() error
StopFlushWorker stops a background process started by StartFlushWorker if it has been started Returns an error if the background task is not running
func (*ProxyConfigCache) StopRefreshWorker ¶
func (pc *ProxyConfigCache) StopRefreshWorker() error
StopRefreshWorker stops a background process started by StartRefreshWorker if it has been started Returns an error if the background task is not running
type Server ¶
Server interface - specifies the interface for gRPC server/adapter
func NewThreescale ¶
NewThreescale returns a Server interface
type Threescale ¶
type Threescale struct {
// contains filtered or unexported fields
}
Threescale contains the Listener and the server
func (*Threescale) Addr ¶
func (s *Threescale) Addr() string
Addr returns the Threescale addrs as a string
func (*Threescale) Close ¶
func (s *Threescale) Close() error
Close stops the Threescale grpc Server
func (*Threescale) HandleAuthorization ¶
func (s *Threescale) HandleAuthorization(ctx context.Context, r *authorization.HandleAuthorizationRequest) (*v1beta1.CheckResult, error)
HandleAuthorization takes care of the authorization request from mixer
func (*Threescale) Run ¶
func (s *Threescale) Run(shutdown chan error)
Run starts the Threescale grpc Server