core

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATTERN = "([a-zA-Z0-9-]+)[^*](.*)"
)

This will match <first-group>:<second-group> of a header Test it here https://regex101.com/r/cn0QvY/1

Variables

This section is empty.

Functions

func Execute added in v1.8.0

func Execute()

func FileContent

func FileContent(filename string) string

func FutureUnixMilli

func FutureUnixMilli(interval int) int64

func HeaderInstance added in v1.7.0

func HeaderInstance() *headers

func LinesFromFile

func LinesFromFile(file string) []string

func Logger added in v1.7.0

func Logger() *logger
func Logo() string

func NewLogger

func NewLogger() *logger

Logger writes each request to $HOME/rip.log.

func NewQueue added in v1.7.0

func NewQueue(limit int) queue

func NowUnixMilli

func NowUnixMilli() int64

func ParseHeaders

func ParseHeaders(args Arguments) *headers

func PrintStats

func PrintStats(stats Statistics) string

func RandomSlice

func RandomSlice(hosts []string) string

func Request

func Request(hosts []string, args Arguments, stats Statistics)

Types

type Arguments

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

func NewArgs added in v1.7.0

func NewArgs() Arguments

func (*Arguments) Bytes

func (flags *Arguments) Bytes() int

func (*Arguments) Concurrent

func (flags *Arguments) Concurrent() int

func (*Arguments) HTTPMethod

func (flags *Arguments) HTTPMethod() string

func (*Arguments) Headers

func (flags *Arguments) Headers() []string

func (*Arguments) Hosts

func (flags *Arguments) Hosts() []string

func (*Arguments) Interval

func (flags *Arguments) Interval() int

func (*Arguments) IsJSONPayload

func (flags *Arguments) IsJSONPayload() bool

func (*Arguments) JSONPayload

func (flags *Arguments) JSONPayload() []byte

func (*Arguments) Logger

func (flags *Arguments) Logger() bool

func (*Arguments) Proxy

func (flags *Arguments) Proxy() string

func (*Arguments) RequestType

func (flags *Arguments) RequestType() string

func (*Arguments) Requests added in v1.7.0

func (flags *Arguments) Requests() int

type Statistics

type Statistics interface {
	SetTotal(totalt int64)
	Total() int64
	SetSuccessful(successful int64)
	Successful() int64
	SetFailure(failed int64)
	Failure() int64
	SetShortest(shortest int64)
	Shortest() int64
	SetLongest(longest int64)
	Longest() int64
	SetElapsedTime(elapsedTime int64)
	ElapsedTime() int64
	SetResponseTime(responseTime int64)
	ResponseTime() int
	SetDataTransferred(dataTransferred int)
	DataTransferred() int
}

type TotalStatistics

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

func NewStatistics

func NewStatistics() TotalStatistics

func (*TotalStatistics) DataTransferred

func (stats *TotalStatistics) DataTransferred() int

func (*TotalStatistics) ElapsedTime

func (stats *TotalStatistics) ElapsedTime() int64

func (*TotalStatistics) Failure

func (stats *TotalStatistics) Failure() int64

func (*TotalStatistics) Longest

func (stats *TotalStatistics) Longest() int64

func (*TotalStatistics) ResponseTime

func (stats *TotalStatistics) ResponseTime() int

func (*TotalStatistics) SetDataTransferred

func (stats *TotalStatistics) SetDataTransferred(dataTransferred int)

func (*TotalStatistics) SetElapsedTime

func (stats *TotalStatistics) SetElapsedTime(elapsedTime int64)

func (*TotalStatistics) SetFailure

func (stats *TotalStatistics) SetFailure(failed int64)

func (*TotalStatistics) SetLongest

func (stats *TotalStatistics) SetLongest(longest int64)

func (*TotalStatistics) SetResponseTime

func (stats *TotalStatistics) SetResponseTime(responseTime int64)

func (*TotalStatistics) SetShortest

func (stats *TotalStatistics) SetShortest(shortest int64)

func (*TotalStatistics) SetSuccessful

func (stats *TotalStatistics) SetSuccessful(successful int64)

func (*TotalStatistics) SetTotal

func (stats *TotalStatistics) SetTotal(total int64)

func (*TotalStatistics) Shortest

func (stats *TotalStatistics) Shortest() int64

func (*TotalStatistics) Successful

func (stats *TotalStatistics) Successful() int64

func (*TotalStatistics) Total

func (stats *TotalStatistics) Total() int64

Jump to

Keyboard shortcuts

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