lib

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day      = 24 * time.Hour
	Week     = 7 * Day
	Month    = 30 * Day
	Year     = 12 * Month
	LongTime = 42 * Year
)

Variables

This section is empty.

Functions

func Bypass added in v0.0.20

func Bypass(tripper http.RoundTripper) http.RoundTripper

func CleanSlug added in v0.0.19

func CleanSlug(s string, setLower bool) string

CleanSlug removes non-alphanumeric characters from a string and will lowercase the string if setLower is true.

func CustomRelativeTime

func CustomRelativeTime(a, b time.Time, albl, blbl string, magnitudes []RelativeTimeMagnitude) string

func Ftoa

func Ftoa(num float64) string

Ftoa converts a float to a string with no trailing zeros.

func FtoaWithDigits

func FtoaWithDigits(num float64, digits int) string

FtoaWithDigits converts a float to a string but limits the resulting string to the given number of decimal places, and no trailing zeros.

func HumanizeTime

func HumanizeTime(then time.Time) string

func RelativeTime

func RelativeTime(a, b time.Time, albl, blbl string) string

func Unique added in v0.1.3

func Unique(x []time.Time) []time.Time

Types

type Options

type Options struct {
	ConfigFile  string
	Debug       bool
	DebugFormat string
	RateLimit   int   // rate limit per second
	MaxFileSize int64 // max file size in mb
	Interactive bool  // Interactive is a flag to enable interactive mode
}

func NewOptions

func NewOptions() *Options

NewOptions returns a new Options struct

type RelativeTimeMagnitude

type RelativeTimeMagnitude struct {
	D      time.Duration
	Format string
	DivBy  time.Duration
}

Jump to

Keyboard shortcuts

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