util

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FormatDateOnly = "2006-01-02"
View Source
const SQLiteDateTime = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func CopyPath

func CopyPath(frm, to string) error

func Expanduser

func Expanduser(path string) string

Expand tilde in path strings

func HashMd5 added in v0.3.0

func HashMd5(bs []byte) string

func HashMd5String

func HashMd5String(s string) string

func HashSha1 added in v0.4.0

func HashSha1(bs []byte) string

func HashSha1String added in v0.4.0

func HashSha1String(s string) string

func ParseISODatetime

func ParseISODatetime(s string) (time.Time, error)

A quick helper for parsing iso time because I find it hard to remember the const name

func ParseSQLiteDatetime

func ParseSQLiteDatetime(s string) (time.Time, error)

Given a datetime string in the form "2022-01-14 06:41:48" parse it to time.Time

@note Rather than parse timestamps we can also pull timestamps out of the db. Here's an example for Chrome:

strftime("%s", visit_time / 1e6 + strftime ('%s', '1601-01-01'), 'unixepoch') AS `timestamp`,

Might be a better approach, but for now I like seeing the extracted time visually for debugging.

func ReverseSlice

func ReverseSlice[S ~[]E, E any](s S) []E

Types

This section is empty.

Jump to

Keyboard shortcuts

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