throttler

package
v0.0.0-...-7d312d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL