app

package
v0.0.0-...-a5e107f Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MemoryFs = afero.NewMemMapFs()
View Source
var OsFs = afero.NewOsFs()

Functions

This section is empty.

Types

type Command

type Command interface {
	Start() error
	Run() error
	ProcessPid() int
	ProcessSignal(sig os.Signal) error
	StdoutPipe() (io.ReadCloser, error)
	StderrPipe() (io.ReadCloser, error)
}

func NewDryRunCommand

func NewDryRunCommand() Command

func NewExecCommand

func NewExecCommand(ctx context.Context, name string, args []string) Command

type DefaultFoundation

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

func (*DefaultFoundation) CurrentUser

func (f *DefaultFoundation) CurrentUser() (*user.User, error)

func (*DefaultFoundation) DryRun

func (f *DefaultFoundation) DryRun() bool

func (*DefaultFoundation) ExecCommand

func (f *DefaultFoundation) ExecCommand(ctx context.Context, name string, args []string) Command

func (*DefaultFoundation) Fs

func (f *DefaultFoundation) Fs() afero.Fs

func (*DefaultFoundation) HttpClient

func (f *DefaultFoundation) HttpClient() HttpClient

func (*DefaultFoundation) Logger

func (f *DefaultFoundation) Logger() *zap.SugaredLogger

func (*DefaultFoundation) LookupEnvVar

func (f *DefaultFoundation) LookupEnvVar(key string) (string, bool)

func (*DefaultFoundation) User

func (f *DefaultFoundation) User(username string) (*user.User, error)

func (*DefaultFoundation) UserGroup

func (f *DefaultFoundation) UserGroup(u *user.User) (*user.Group, error)

func (*DefaultFoundation) UserHomeDir

func (f *DefaultFoundation) UserHomeDir() (string, error)

func (*DefaultFoundation) VegetaAttacker

func (f *DefaultFoundation) VegetaAttacker() VegetaAttacker

func (*DefaultFoundation) VegetaMetrics

func (f *DefaultFoundation) VegetaMetrics() VegetaMetrics

type DefaultVegetaMetrics

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

func (DefaultVegetaMetrics) Add

func (DefaultVegetaMetrics) Close

func (m DefaultVegetaMetrics) Close()

func (DefaultVegetaMetrics) Metrics

func (m DefaultVegetaMetrics) Metrics() *vegeta.Metrics

type DryRunCommand

type DryRunCommand struct {
}

func (DryRunCommand) ProcessPid

func (c DryRunCommand) ProcessPid() int

func (DryRunCommand) ProcessSignal

func (c DryRunCommand) ProcessSignal(sig os.Signal) error

func (DryRunCommand) Run

func (c DryRunCommand) Run() error

func (DryRunCommand) Start

func (c DryRunCommand) Start() error

func (DryRunCommand) StderrPipe

func (c DryRunCommand) StderrPipe() (io.ReadCloser, error)

func (DryRunCommand) StdoutPipe

func (c DryRunCommand) StdoutPipe() (io.ReadCloser, error)

type DryRunHttpClient

type DryRunHttpClient struct {
}

func (*DryRunHttpClient) Do

func (c *DryRunHttpClient) Do(req *http.Request) (*http.Response, error)

type DryRunVegetaAttacker

type DryRunVegetaAttacker struct{}

func (*DryRunVegetaAttacker) Attack

func (a *DryRunVegetaAttacker) Attack(
	targeter vegeta.Targeter,
	rate vegeta.Rate,
	duration time.Duration,
	name string,
) <-chan *vegeta.Result

type DummyReaderCloser

type DummyReaderCloser struct{}

func (*DummyReaderCloser) Close

func (drc *DummyReaderCloser) Close() error

func (*DummyReaderCloser) Read

func (drc *DummyReaderCloser) Read(p []byte) (n int, err error)

type ExecCommand

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

func (ExecCommand) ProcessPid

func (c ExecCommand) ProcessPid() int

func (ExecCommand) ProcessSignal

func (c ExecCommand) ProcessSignal(sig os.Signal) error

func (ExecCommand) Run

func (c ExecCommand) Run() error

func (ExecCommand) Start

func (c ExecCommand) Start() error

func (ExecCommand) StderrPipe

func (c ExecCommand) StderrPipe() (io.ReadCloser, error)

func (ExecCommand) StdoutPipe

func (c ExecCommand) StdoutPipe() (io.ReadCloser, error)

type Foundation

type Foundation interface {
	Logger() *zap.SugaredLogger
	Fs() afero.Fs
	CurrentUser() (*user.User, error)
	DryRun() bool
	User(username string) (*user.User, error)
	UserGroup(u *user.User) (*user.Group, error)
	UserHomeDir() (string, error)
	LookupEnvVar(key string) (string, bool)
	ExecCommand(ctx context.Context, name string, args []string) Command
	HttpClient() HttpClient
	VegetaAttacker() VegetaAttacker
	VegetaMetrics() VegetaMetrics
}

func NewFoundation

func NewFoundation(logger *zap.SugaredLogger, dryRun bool) Foundation

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

func NewDryRunHttpClient

func NewDryRunHttpClient() HttpClient

func NewRealHttpClient

func NewRealHttpClient() HttpClient

type RealHttpClient

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

func (*RealHttpClient) Do

func (c *RealHttpClient) Do(req *http.Request) (*http.Response, error)

type RealVegetaAttacker

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

func (*RealVegetaAttacker) Attack

func (a *RealVegetaAttacker) Attack(
	targeter vegeta.Targeter,
	rate vegeta.Rate,
	duration time.Duration,
	name string,
) <-chan *vegeta.Result

type VegetaAttacker

type VegetaAttacker interface {
	Attack(targeter vegeta.Targeter, rate vegeta.Rate, duration time.Duration, name string) <-chan *vegeta.Result
}

func NewDryRunVegetaAttacker

func NewDryRunVegetaAttacker() VegetaAttacker

func NewRealVegetaAttacker

func NewRealVegetaAttacker() VegetaAttacker

type VegetaMetrics

type VegetaMetrics interface {
	Add(r *vegeta.Result)
	Close()
	Metrics() *vegeta.Metrics
}

func NewDefaultVegetaMetrics

func NewDefaultVegetaMetrics() VegetaMetrics

Jump to

Keyboard shortcuts

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