keygen

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package keygen is a sample workload for our demo server. As a sample time consuming work load, this package generates RSA private/public key pairs.

See the Config struct for a set of parameters for this workload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable bool `json:"enable"`

	// This limits the amount of work to do.  The workload will stop when either
	// of these is complete.  Zero is interpreted as "infinity".  TimeToRun is in
	// seconds.
	NumToGen  int `json:"numToGen" mapstructure:"num-to-gen"`
	TimeToRun int `json:"timeToRun" mapstructure:"time-to-run"`

	// If both of these variables are set, then the keygen worker will pull work
	// items off of the MemQ.  If there is an error it will keep retrying with a
	// small pause.  If the queue is empty, and exitOnComplete is set, then the
	// process will exit.  If MemQ is used, then NumToGen and TimeToRun are
	// ignored.
	MemQServer string `json:"memQServer" mapstructure:"memq-server"`
	MemQQueue  string `json:"memQQueue" mapstructure:"memq-queue"`

	// What should happen when the workload is complete?
	ExitOnComplete bool `json:"exitOnComplete" mapstructure:"exit-on-complete"`
	ExitCode       int  `json:"exitCode" mapstructure:"exit-code"`
}

Config is the input parameters to the keygen workload.

type History

type History struct {
	ID   int    `json:"id"`
	Data string `json:"data"`
}

type KeyGen

type KeyGen struct {
	// contains filtered or unexported fields
}

func New

func New() *KeyGen

func (*KeyGen) APIGet

func (kg *KeyGen) APIGet(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*KeyGen) APIPut

func (kg *KeyGen) APIPut(w http.ResponseWriter, r *http.Request, params httprouter.Params)

func (*KeyGen) AddRoutes

func (kg *KeyGen) AddRoutes(router *httprouter.Router, base string)

func (*KeyGen) BindConfig

func (kg *KeyGen) BindConfig(v *viper.Viper, fs *pflag.FlagSet)

func (*KeyGen) LoadConfig

func (kg *KeyGen) LoadConfig(c Config)

func (*KeyGen) Restart

func (kg *KeyGen) Restart()

func (*KeyGen) WorkloadOutput

func (kg *KeyGen) WorkloadOutput(s string)

type KeyGenStatus

type KeyGenStatus struct {
	Config  Config    `json:"config"`
	History []History `json:"history"`
}

ProbeStatus is returned from a GET to this API endpoing

Jump to

Keyboard shortcuts

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