records

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_STATUS = http.StatusOK
View Source
const MAX_SLEEP = (15 * time.Second)
View Source
const RECORD_HASH_STRING = "status=%d|method=%s|endpoint=%s|header=%#v|sleep=%v|echo=%v"

Used to create a string for hashing a Record

View Source
const RECORD_HEADER = "X-Noopserverflags"
View Source
const SPLIT_HEADER_VALUE = ":"
View Source
const SPLIT_RECORD_HEADER = ";"

Variables

View Source
var VALID_SCHEMES = []string{"http", "https"}

Functions

This section is empty.

Types

type Record

type Record struct {
	Timestamp  time.Time
	Iterations int
	Headers    *http.Header

	Method string
	Status int
	Sleep  time.Duration
	Echo   bool
	// contains filtered or unexported fields
}

func NewRecord

func NewRecord(req *http.Request, dHost string, sleep time.Duration, echo bool) Record

func (*Record) DoSleep

func (r *Record) DoSleep()

func (*Record) Endpoint

func (r *Record) Endpoint() string

Takes listener for a default Host, if not provided.

func (*Record) Path added in v1.3.1

func (r *Record) Path() string

type RecordMap

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

WARNING: This will grow with variable requests

func GetStore

func GetStore() *RecordMap

func NewRecordMap

func NewRecordMap() *RecordMap

func (*RecordMap) Add

func (rm *RecordMap) Add(rec Record)

Returns true if the item was added, and false if it was updated

func (*RecordMap) Iterations added in v1.3.2

func (rm *RecordMap) Iterations() int

func (*RecordMap) Size

func (rm *RecordMap) Size() int

func (*RecordMap) Snapshot

func (rm *RecordMap) Snapshot() map[string]Record

Returns a snapshot of k/v pair at the moment

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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