Documentation ¶
Index ¶
Constants ¶
View Source
const ( MaxBurstDefault = 2 BurstDelaySecsDefault = 300 )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultThrottlerCfg ¶
func GetDefaultThrottlerCfg() *config.ThrottlerCfg
Types ¶
type ThrottlerData ¶
type ThrottlerData struct { CommitTimes []time.Time `json:"commit_times"` ThrottlerCfg *config.ThrottlerCfg `json:"throttler_cfg"` }
type ThrottlerImpl ¶
type ThrottlerImpl struct {
// contains filtered or unexported fields
}
ThrottlerImpl implements the types.ThrottlerManager interface. NOTE: This implementation is not thread safe.
func NewThrottler ¶
func NewThrottler() *ThrottlerImpl
GetThrottler returns an instance of ThrottlerImpl.
func (*ThrottlerImpl) Throttle ¶
func (t *ThrottlerImpl) Throttle(repoBranch string, commitTime time.Time) bool
Throttle implements the types.ThrottlerManager interface.
func (*ThrottlerImpl) UpdateThrottler ¶
func (t *ThrottlerImpl) UpdateThrottler(repoBranch string, commitTime time.Time, throttlerCfg *config.ThrottlerCfg)
UpdateThrottler implements the types.ThrottlerManager interface.
Click to show internal directories.
Click to hide internal directories.