common

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OneSecMs    = 1000
	OneMinuteMs = 60 * OneSecMs
	OneHourMs   = 60 * OneMinuteMs
	OneDayMs    = 24 * OneHourMs
	OneYearMs   = 365 * OneDayMs
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(level string) (logger.Logger, error)

func Str2duration

func Str2duration(duration string) (time.Duration, error)

Convert a "[0-9]+[mhd]" duration string (for example, "24h") to a Unix timestamp in milliseconds integer

func String2Time

func String2Time(timeString string) (time.Time, error)

Convert a time string to a time object. The input time string can be of the format "now", "now-[0-9]+[mdh]" (for example, "now-2h"), "<Unix timestamp>", or "<RFC 3339 time>" (for example, "2018-09-26T14:10:20Z").

func UrlParse

func UrlParse(fullpath string, forceDir bool) (*backends.PathParams, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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