pkg

package
v0.0.0-...-b50c9e6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *bbolt.DB

Create an exported global variable to hold the database connection pool.

Functions

func GetBoltContent

func GetBoltContent() []string

TODO - get everything from the database, all k/v pairs GetBoltContent get everything in the database

func LoopRequest

func LoopRequest(d time.Duration, f func(key string), uniqueKey string)

LoopRequest perform the loop

func LoopRequestFullSpeed

func LoopRequestFullSpeed(f func(key string), uniqueKey string)

func MakeRequestWithRandomUpdate

func MakeRequestWithRandomUpdate(uniqueKey string)

MakeRequestWithRandomUpdate make out bound call

func PutDatabaseItem

func PutDatabaseItem(item *Item) error

PutDatabaseItem performs verification of inbound requests against database state

func ReportStats

func ReportStats()

ReportStats reports stats on the database every 10s

func RunHttpServer

func RunHttpServer()

RunHttpServer - executes the API that will be hit for the experiment

func StartDatabase

func StartDatabase()

Create the database file

func WriteItem

func WriteItem(item *Item)

WriteItem write a single item to the database using key

Types

type CState

type CState struct {
	Value string `json:"key"`
}

type Item

type Item struct {
	Key   string  `json:"key"`
	Value string  `json:"value"`
	State []State `json:"state"`
}

type OutboundRequest

type OutboundRequest struct {
	Key    string   `json:"key"`
	Value  string   `json:"value"`
	States []CState `json:"state"`
}

type State

type State struct {
	Value string `json:"key"`
}

func GetBoltContentAsState

func GetBoltContentAsState() []State

type States

type States struct {
	States []CState `json:"state"`
}

type Values

type Values struct {
	State []State `json:"state"`
}

Jump to

Keyboard shortcuts

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