testshlp

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCtxLogger

func CreateCtxLogger(t *testing.T) (context.Context, glog.Logger)

CreateCtxLogger creates a context with logger

func CreateCtxLoggerWithCancel

func CreateCtxLoggerWithCancel(t *testing.T) (context.Context, context.CancelFunc, glog.Logger)

CreateCtxLoggerWithCancel creates a context with logger and cancel function

func SetEnvFromFile

func SetEnvFromFile(envPath string) error

SetEnvFromFile sets environment variables from file

Types

type CallHlp

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

CallHlp is a type for call helper

func (*CallHlp) AddErrMap

func (ch *CallHlp) AddErrMap(fn interface{}, errMap map[int]error)

AddErrMap adds error map

func (*CallHlp) Call

func (ch *CallHlp) Call(fn interface{}) error

Call calls function

type EnvVar

type EnvVar struct {
	Name              string
	DefaultVal        string
	DontUseDefaultVal bool
}

EnvVar is a type for environment variables

func (EnvVar) GetBool

func (ev EnvVar) GetBool() bool

GetBool gets environment variable value as bool

func (EnvVar) GetValOrDefault

func (ev EnvVar) GetValOrDefault() string

GetValOrDefault gets environment variable value or default value

Jump to

Keyboard shortcuts

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