utils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

View Source
const (
	DATE_FORMAT     = "2006-01-02"
	DATETIME_FORMAT = "2006-01-02 03-04-05"
)

Variables

This section is empty.

Functions

func EnsureDirOf

func EnsureDirOf(path string) error

func ExpandUserPath

func ExpandUserPath(path string) string

func FormatDate

func FormatDate(t time.Time) string

func FormatTime

func FormatTime(t time.Time) string

func IsDirEmpty

func IsDirEmpty(name string) (bool, error)

func JsonDecodeBytes

func JsonDecodeBytes(bytes []byte) (interface{}, error)

func JsonDecodeFile

func JsonDecodeFile(path string) (interface{}, error)

func JsonDecodeStr

func JsonDecodeStr(str string) (interface{}, error)

func JsonGet

func JsonGet(url string, onReq func(req *http.Request)) (interface{}, *http.Response, error)

func JsonToQueryString

func JsonToQueryString(json StringMap) string

func NeedsRefresh

func NeedsRefresh(refresh_type int32, last_refreshed_at time.Time, now time.Time) bool

func OpenBrowser added in v0.0.4

func OpenBrowser(url string)

*

  • Opens the browser pointing to a given URL.

func ParseDate

func ParseDate(str string) time.Time

func ParseTime

func ParseTime(str string) time.Time

func PriceString

func PriceString(value float64) string

Types

type StringMap

type StringMap = map[string]interface{}

Jump to

Keyboard shortcuts

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