common

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Success is the string constant emitted at the end of the Bookbuyer/Bookthief logs when the test succeeded.
	Success = "MAESTRO! THIS TEST SUCCEEDED!"

	// Failure is the string constant emitted at the end of the Bookbuyer/Bookthief logs when the test failed.
	Failure = "MAESTRO, WE HAVE A PROBLEM! THIS TEST FAILED!"

	// BooksBoughtHeader is the header returned by the bookstore and observed by the bookbuyer.
	BooksBoughtHeader = "Booksbought"

	// IdentityHeader is the header returned by the bookstore and observed by the bookbuyer.
	IdentityHeader = "Identity"

	// BookstoreNamespaceEnvVar is the environment variable for the Bookbuyer namespace.
	BookstoreNamespaceEnvVar = "BOOKSTORE_NAMESPACE"

	// BookwarehouseNamespaceEnvVar is the environment variable for the Bookwarehouse namespace.
	BookwarehouseNamespaceEnvVar = "BOOKWAREHOUSE_NAMESPACE"

	// BookthiefExpectedResponseCodeEnvVar is the environment variable for Bookthief's expected HTTP response code
	BookthiefExpectedResponseCodeEnvVar = "BOOKTHIEF_EXPECTED_RESPONSE_CODE"

	// EnableEgressEnvVar is the environment variable to enable egress requests in the demo
	EnableEgressEnvVar = "ENABLE_EGRESS"
)
View Source
const (
	// RestockWarehouseURL is a header string constant.
	RestockWarehouseURL = "restock-books"
)

Variables

This section is empty.

Functions

func GetBooks

func GetBooks(participantName string, meshExpectedResponseCode int, booksCount *int64, booksCountV1 *int64, booksCountV2 *int64)

GetBooks reaches out to the bookstore and buys/steals books. This is invoked by the bookbuyer and the bookthief.

func GetExpectedResponseCodeFromEnvVar

func GetExpectedResponseCodeFromEnvVar(envVar, defaultValue string) int

GetExpectedResponseCodeFromEnvVar returns the expected response code based on the given environment variable

func RestockBooks

func RestockBooks(amount int)

RestockBooks restocks the bookstore with certain amount of books from the warehouse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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