app

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 15 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 {
	IsRunning() bool
	Start() error
	Run() error
	ProcessPid() int
	ProcessSignal(sig os.Signal) error
	StdoutPipe() (io.ReadCloser, error)
	StderrPipe() (io.ReadCloser, error)
	SetStdout(stdout io.Writer)
	SetStderr(stdout io.Writer)
	String() string
	Wait() error
}

func NewDryRunCommand

func NewDryRunCommand(name string, args []string) 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) Chdir

func (f *DefaultFoundation) Chdir(s string) error

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() Fs

func (*DefaultFoundation) GenerateUuid

func (f *DefaultFoundation) GenerateUuid() string

func (*DefaultFoundation) Getwd

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

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 {
	// contains filtered or unexported fields
}

func (DryRunCommand) IsRunning

func (c DryRunCommand) IsRunning() bool

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) SetStderr

func (c DryRunCommand) SetStderr(stdout io.Writer)

func (DryRunCommand) SetStdout

func (c DryRunCommand) SetStdout(stdout io.Writer)

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)

func (DryRunCommand) String

func (c DryRunCommand) String() string

func (DryRunCommand) Wait

func (c DryRunCommand) Wait() 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) IsRunning

func (c ExecCommand) IsRunning() bool

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) SetStderr

func (c ExecCommand) SetStderr(stderr io.Writer)

func (ExecCommand) SetStdout

func (c ExecCommand) SetStdout(stdout io.Writer)

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)

func (ExecCommand) String

func (c ExecCommand) String() string

func (ExecCommand) Wait

func (c ExecCommand) Wait() error

type File

type File interface {
	afero.File
}

type Foundation

type Foundation interface {
	Logger() *zap.SugaredLogger
	Fs() Fs
	CurrentUser() (*user.User, error)
	Chdir(string) error
	Getwd() (string, 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
	GenerateUuid() string
}

func NewFoundation

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

type Fs

type Fs interface {
	afero.Fs
}

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