verify

package
v3.0.0-...-eac99ac Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 10

Documentation

Index

Constants

View Source
const ENV_VERIFY = "ETCD_VERIFY"

Variables

This section is empty.

Functions

func Assert

func Assert(condition bool, msg string, v ...interface{})

Assert will panic with a given formatted message if the given condition is false.

func DisableVerifications

func DisableVerifications() func()

DisableVerifications unsets `ENV_VERIFY` and returns a function that can be used to bring the original settings.

func EnableAllVerifications

func EnableAllVerifications() func()

EnableAllVerifications enables verification and returns a function that can be used to bring the original settings.

func EnableVerifications

func EnableVerifications(verification VerificationType) func()

EnableVerifications sets `ENV_VERIFY` and returns a function that can be used to bring the original settings.

func IsVerificationEnabled

func IsVerificationEnabled(verification VerificationType) bool

func Verify

func Verify(f func())

Verify performs verification if the assertions are enabled. In the default setup running in tests and skipped in the production code.

Types

type VerificationType

type VerificationType string
const (
	ENV_VERIFY_VALUE_ALL    VerificationType = "all"
	ENV_VERIFY_VALUE_ASSERT VerificationType = "assert"
)

Jump to

Keyboard shortcuts

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