Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatastoreThrottle ¶
type DatastoreThrottle struct{}
DatastoreThrottle is an implementation of Throttle which uses Datastore.
func NewDatastore ¶
func NewDatastore(ctx context.Context) *DatastoreThrottle
NewDatastore returns an implementation of Throttle which uses Datastore.
func (*DatastoreThrottle) Reset ¶
func (t *DatastoreThrottle) Reset(ctx context.Context, roller string) error
Reset implements the Throttle interface.
func (*DatastoreThrottle) Unthrottle ¶
func (t *DatastoreThrottle) Unthrottle(ctx context.Context, roller string) error
Unthrottle implements the Throttle interface.
type Throttle ¶
type Throttle interface { // Unthrottle the given roller. Unthrottle(ctx context.Context, roller string) error // Reset the should-unthrottle status of the roller, allowing it to become // throttled again if necessary. Reset(ctx context.Context, roller string) error // Get determines whether the given roller should be unthrottled. Get(ctx context.Context, roller string) (bool, error) }
Throttle tracks whether a given roller should be throttled. TODO(borenet): This should include throttle-enabling as well as disabling, and it should maintain history like modes and strategies.
Click to show internal directories.
Click to hide internal directories.