testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InputItemList = []TestItem{
	NewTestItem("item1"),
	NewTestItem("item2"),
	NewTestItem("item3"),
	NewTestItem("item4"),
	NewTestItem("item5"),
}

Functions

func Debug

func Debug(topic TxnTopic, format string, a ...interface{})

func WaitForServer

func WaitForServer(address string, port int, timeout time.Duration) error

WaitForServer waits for the server at the specified address and port to respond with a heartbeat within the given timeout duration. It periodically sends HTTP GET requests to the server's heartbeat endpoint until a successful response is received or the timeout is reached. If a successful response is received within the timeout, it returns nil. Otherwise, it returns an error indicating that the server did not reply within the specified timeout.

Types

type Person

type Person struct {
	Name string
	Age  int
}

func NewDefaultPerson

func NewDefaultPerson() Person

NewDefaultPerson returns a new testutil.Person with default values. The default values are: - Name: "John" - Age: 30

func NewPerson

func NewPerson(name string) Person

NewPerson creates a new testutil.Person with the given name and default age of 30.

type TestItem

type TestItem struct {
	Value string
}

func NewTestItem

func NewTestItem(value string) TestItem

NewTestItem creates a new testutil.TestItem with the specified value.

type TxnTopic

type TxnTopic string
const (
	DConn    TxnTopic = "CONN"
	DRead    TxnTopic = "READ"
	DWrite   TxnTopic = "WRITE"
	DDelete  TxnTopic = "DELETE"
	DCommit  TxnTopic = "COMMIT"
	DAbort   TxnTopic = "ABORT"
	DInfo    TxnTopic = "INFO"
	DTest    TxnTopic = "TEST"
	DPrepare TxnTopic = "PREPARE"
	DConUpdt TxnTopic = "CONUPDT"
	DTSR     TxnTopic = "TSR"
)

Jump to

Keyboard shortcuts

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