utils

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateFromISOWeek

func DateFromISOWeek(isoYear int, isoWeek int) (date time.Time)

Calculate the actual date which represents the start of the given ISOWeek

func ExtractGzip

func ExtractGzip(file, destDir string, skipHidden bool) (root string, err error)

ExtractGzip extracts a gzipped archive to the specified directory and returns the path to the root level of the extracted archive. Caller must ensure that the destination directory exists.

func Latest added in v1.5.3

func Latest(a, b string) string

Helper method to return the latest string timestamp from the two RFC3339 timestamps

func WriteGzip

func WriteGzip(dir, file string) (err error)

WriteGzip compresses a directory to a gzipped archive.

Types

type Week

type Week struct {
	Date    time.Time
	Year    int
	WeekNum int
}

func NewWeek

func NewWeek(date time.Time) (week *Week)

Returns a new Week object given a time.Time

func (*Week) Sub

func (w *Week) Sub(u *Week) int

Returns the difference w-u between two Weeks, in terms of number of weeks

type WeekIterator

type WeekIterator struct {
	Start   *Week
	Current *Week
	End     *Week
}

func GetWeekIterator

func GetWeekIterator(start time.Time, end time.Time) (iter *WeekIterator, err error)

Takes in a time range and returns a WeekIterator

func (*WeekIterator) Next

func (i *WeekIterator) Next() (week *Week, ok bool)

Returns the next Week from the WeekIterator

Directories

Path Synopsis
Package wire is a store helper package that handles "wire" representations of the objects being managed in the store - e.g.
Package wire is a store helper package that handles "wire" representations of the objects being managed in the store - e.g.

Jump to

Keyboard shortcuts

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