project

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package project defines global project helpers.

Index

Constants

View Source
const (
	// RFC3339Date formats time as RFC3339 but without a time component (e.g.
	// 2020-11-24 for November 24, 20202).
	RFC3339Date = "2006-01-02"

	// RFC3339Squish is the RFC3339 datetime but all dashes and timezone
	// indicators are removed. This is useful for filenames.
	RFC3339Squish = "20060102150405"
)
View Source
const (
	// PasswordSentinel is the password string inserted into forms.
	PasswordSentinel = "very-nice-try-maybe-next-time"
)

Variables

This section is empty.

Functions

func RandomBase64String added in v0.18.0

func RandomBase64String(len int) (string, error)

RandomBase64String encodes a random base64 string of a given length.

func RandomString added in v0.18.0

func RandomString() (string, error)

RandomString generates a random string of 32 characters in length

func Root

func Root() string

Root returns the filepath to the root of this project.

func TrimSpace added in v0.16.0

func TrimSpace(s string) string

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

func TrimSpaceAndNonPrintable added in v0.16.0

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