common

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashBitsUsed          = 48
	HashBytesUsed         = HashBitsUsed / 8
	EncodedHashByteLength = HashBytesUsed * 2
)
View Source
const (
	NAME_NOT_AVAILABLE         = "anonymous"
	ANTITHESIS_SDK_MODULE      = "github.com/antithesishq/antithesis-sdk-go"
	ASSERT_PACKAGE             = "assert"
	INSTRUMENTATION_PACKAGE    = "instrumentation"
	NOTIFIER_MODULE_NAME       = "antithesis.notifier"
	GENERATED_SUFFIX           = "_antithesis_catalog.go"
	INSTRUMENTED_SOURCE_FOLDER = "customer"
	SYMBOLS_FOLDER             = "symbols"
	SYMBOLS_FILE_HASH_PREFIX   = "go"
	SYMBOLS_FILE_SUFFIX        = ".sym.tsv"
	NOTIFIER_FOLDER            = "notifier"
	GENERATED_NOTIFIER_SOURCE  = "notifier.go"
	NOTIFIER_PACKAGE_PREFIX    = "z"
)

Variables

This section is empty.

Functions

func AddDependencies

func AddDependencies(customerInputDirectory, customerOutputDirectory, instrumentorVersion, notifierModule string)

func AssertPackageName added in v0.2.10

func AssertPackageName() string

func CopyRecursiveNoClobber

func CopyRecursiveNoClobber(from, to string)

func FetchDependencies added in v0.2.10

func FetchDependencies(customerOutputDirectory string)

func FullNotifierName added in v0.2.10

func FullNotifierName(filesHash string) string

require antithesis.notifier/z4a1b45a05078

func GetAbsoluteDirectory

func GetAbsoluteDirectory(path string) string

GetAbsoluteDirectory converts a path, whether a symlink or a relative path, into an absolute path.

func HashFileContent

func HashFileContent(paths []string) string

HashFileContent reads the binary content of every file in paths (assumed to be in lexical order) and returns the SHA-256 digest.

func InstrumentationPackageName added in v0.2.10

func InstrumentationPackageName() string

func NotifierDependencies added in v0.2.10

func NotifierDependencies(notifierOutputDirectory, notifierModuleName, instrumentorVersion, localSDKPath string)

func NotifierPackage added in v0.2.10

func NotifierPackage(filesHash string) string

package z4a1b45a05078

func Pluralize

func Pluralize(val int, singularText string) string

func SDKPackageName added in v0.2.10

func SDKPackageName(packageName string) string

func ValidateDirectories

func ValidateDirectories(input, output string) (err error)

ValidateDirectories checks that neither directory is a child of the other, and of course that they're not the same.

func WriteTextFile

func WriteTextFile(text, file_name string) (err error)

Types

type LogWriter

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

func GetLogWriter

func GetLogWriter() *LogWriter

func NewLogWriter

func NewLogWriter(logfileName string, vLevel int) *LogWriter

func (*LogWriter) Fatal

func (lW *LogWriter) Fatal(v ...any)

func (*LogWriter) Fatalf

func (lW *LogWriter) Fatalf(format string, v ...any)

func (*LogWriter) IsVerbose

func (lW *LogWriter) IsVerbose() bool

func (*LogWriter) Printf

func (lW *LogWriter) Printf(format string, v ...any)

func (*LogWriter) VerboseLevel

func (lW *LogWriter) VerboseLevel(v int) bool

Jump to

Keyboard shortcuts

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