common

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: Apache-2.0 Imports: 8 Imported by: 1

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