project

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package project contains project level utilities that don't have another good home.

Index

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

func RandomBase64String(length int) (string, error)

RandomBase64String encodes a random base64 string of a given length.

func RandomBytes added in v0.22.0

func RandomBytes(length int) ([]byte, error)

RandomBytes returns a byte slice of random values of the given length.

func RandomHexString added in v0.22.0

func RandomHexString(length int) (string, error)

RandomHexString generates a random string of the provided length.

func Root added in v0.23.0

func Root(more ...string) string

Root returns the filepath to the root of this project.

func TestContext added in v0.22.0

func TestContext(tb testing.TB) context.Context

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 TrimSpace

func TrimSpace(s string) string

TrimSpace trims space and "zero-width no-break space"

func TrimSpaceAndNonPrintable

func TrimSpaceAndNonPrintable(s string) string

TrimSpaceAndNonPrintable trims spaces and non-printable chars from the beginning and end of a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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