Documentation ¶
Overview ¶
Package project contains project level utilities that don't have another good home.
Index ¶
- func DevMode() bool
- func RandomBase64String(length int) (string, error)
- func RandomBytes(length int) ([]byte, error)
- func RandomHexString(length int) (string, error)
- func Root(more ...string) string
- func TestContext(tb testing.TB) context.Context
- func TestLogger(tb testing.TB) *zap.SugaredLogger
- func TrimSpace(s string) string
- func TrimSpaceAndNonPrintable(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DevMode ¶ added in v0.23.0
func DevMode() bool
DevMode indicates whether the project is running in development mode.
func RandomBase64String ¶ added in v0.22.0
RandomBase64String encodes a random base64 string of a given length.
func RandomBytes ¶ added in v0.22.0
RandomBytes returns a byte slice of random values of the given length.
func RandomHexString ¶ added in v0.22.0
RandomHexString generates a random string of the provided length.
func TestContext ¶ added in v0.22.0
TestContext returns a context with test values pre-populated.
func TestLogger ¶ added in v0.22.0
func TestLogger(tb testing.TB) *zap.SugaredLogger
TestLogger returns a logger configured for test. See the following link for more information:
https://pkg.go.dev/go.uber.org/zap/zaptest
func TrimSpaceAndNonPrintable ¶
TrimSpaceAndNonPrintable trims spaces and non-printable chars from the beginning and end of a string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.