varinterval

package
v2.0.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMaxIncreaseDelta = errors.New("invalid max_increase_delta")

ErrInvalidMaxIncreaseDelta is returned for a config with an invalid MaxIncreaseDelta.

View Source
var ErrInvalidModifyResponseProbability = errors.New("invalid modify_response_probability")

ErrInvalidModifyResponseProbability is returned for a config with an invalid ModifyResponseProbability.

Functions

func New

func New(cfg Config) (middleware.Hook, error)

New creates a middleware to randomly modify the announce interval from the given config.

Types

type Config

type Config struct {
	// ModifyResponseProbability is the probability by which a response will
	// be modified.
	ModifyResponseProbability float32 `yaml:"modify_response_probability"`

	// MaxIncreaseDelta is the amount of seconds that will be added at most.
	MaxIncreaseDelta int `yaml:"max_increase_delta"`

	// ModifyMinInterval specifies whether min_interval should be increased
	// as well.
	ModifyMinInterval bool `yaml:"modify_min_interval"`
}

Config represents the configuration for the varinterval middleware.

Jump to

Keyboard shortcuts

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