utils

package
v0.0.0-...-0776cf7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

Letters is a string containing all ASCII letters, including both cases

Variables

This section is empty.

Functions

func DayEnd

func DayEnd(now time.Time) time.Time

DayEnd returns the end of the current day This is technically just the start of the following day, because it's easier

func DayStart

func DayStart(now time.Time) time.Time

DayStart returns the start of the current day

func FixedWidthAppend

func FixedWidthAppend(s string, width int) string

FixedWidthAppend returns a string with an exact length, appending whitespace if extra characters are needed

func FixedWidthPrepend

func FixedWidthPrepend(s string, width int) string

FixedWidthPrepend works exactly like FixedWidthAppend, but prepends whitespace instead of appending

func HourEnd

func HourEnd(now time.Time) time.Time

Returns the end of the current hour This works akin to DayEnd in that it's just the start of the following hour

func HourStart

func HourStart(now time.Time) time.Time

HourStart returns the start of the current hour

func RandString

func RandString(n int) string

RandString generates a random string of length n, containing only ASCII letters

func TemplateString

func TemplateString(base string, data any) (string, error)

TemplateString is a helper function to render a template string with the given data

Types

This section is empty.

Jump to

Keyboard shortcuts

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