Documentation ¶
Overview ¶
Package job [contains all the attack types db1000n can simulate]
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseConfig ¶
func ParseConfig(c Config, args config.Args, global GlobalConfig) error
Types ¶
type BasicJobConfig ¶
type BasicJobConfig struct { IntervalMs int Interval *time.Duration utils.Counter Backoff *utils.BackoffConfig }
BasicJobConfig comment for linter
func (*BasicJobConfig) FromGlobal ¶
func (c *BasicJobConfig) FromGlobal(global GlobalConfig)
func (BasicJobConfig) GetInterval ¶
func (c BasicJobConfig) GetInterval() time.Duration
type Config ¶
type Config interface {
FromGlobal(GlobalConfig)
}
type ConfigOptions ¶
type ConfigOptions struct { PathsCSV string // Comma-separated config location URLs BackupConfig string // Raw backup config Format string // json or yaml RefreshTimeout time.Duration // How often to refresh config }
ConfigOptions for fetching job configs for the runner
func NewConfigOptionsWithFlags ¶
func NewConfigOptionsWithFlags() *ConfigOptions
NewConfigOptionsWithFlags returns ConfigOptions initialized with command line flags.
type GlobalConfig ¶
type GlobalConfig struct { ClientID string ProxyURLs string SkipEncrypted bool EnablePrimitiveJobs bool ScaleFactor int MinInterval time.Duration Backoff utils.BackoffConfig }
GlobalConfig passes commandline arguments to every job.
func NewGlobalConfigWithFlags ¶
func NewGlobalConfigWithFlags() *GlobalConfig
NewGlobalConfigWithFlags returns a GlobalConfig initialized with command line flags.
type Job ¶
type Job = func(ctx context.Context, args config.Args, globalConfig *GlobalConfig, a *metrics.Accumulator, logger *zap.Logger) (data any, err error)
Job comment for linter
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes jobs according to the (fetched from remote) configuration
func NewRunner ¶
func NewRunner(cfgOptions *ConfigOptions, globalJobsCfg *GlobalConfig) *Runner
NewRunner according to the config
Source Files ¶
Click to show internal directories.
Click to hide internal directories.