Documentation ¶
Index ¶
- func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, dbPath string, opts ...Option) (*connectorRunner, error)
- func NewEmptyConnector() (*emptyConnector, error)
- type Option
- func WithExternalLimiter(address string, opts map[string]string) Option
- func WithFixedMemoryLimiter(rate int64, period time.Duration) Option
- func WithGrant(entitlementID string, principalID string, principalType string) Option
- func WithRateLimitDescriptor(entry *ratelimitV1.RateLimitDescriptors_Entry) Option
- func WithRateLimiterConfig(cfg *ratelimitV1.RateLimiterConfig) Option
- func WithRevoke(grantID string) Option
- func WithSlidingMemoryLimiter(usePercent int64) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnectorRunner ¶
func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, dbPath string, opts ...Option) (*connectorRunner, error)
NewConnectorRunner creates a new connector runner.
func NewEmptyConnector ¶
func NewEmptyConnector() (*emptyConnector, error)
NewEmptyConnector returns a new emptyConnector.
Types ¶
type Option ¶
func WithExternalLimiter ¶
WithExternalLimiter configures the connector to use an external rate limiter. The `opts` map is injected into the environment in order for the service to be configured.
func WithFixedMemoryLimiter ¶
WithFixedMemoryLimiter configures to use a fixed-memory limiter. `rate` is a number on how many times it should be in the given period executed. `period` represents the elapsed time between two instants as an int64 nanosecond count.
func WithRateLimitDescriptor ¶
func WithRateLimitDescriptor(entry *ratelimitV1.RateLimitDescriptors_Entry) Option
WithRateLimitDescriptor takes a rate limit descriptor and adds it to the list of rate limit descriptors.
func WithRateLimiterConfig ¶
func WithRateLimiterConfig(cfg *ratelimitV1.RateLimiterConfig) Option
WithRateLimiterConfig sets the RateLimiterConfig for a runner.
func WithRevoke ¶ added in v0.0.30
func WithSlidingMemoryLimiter ¶
WithSlidingMemoryLimiter configures the connector to use an in-memory rate limiter that adjusts to maintain fairness based on request headers. `usePercent` is value between 0 and 100.