util

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AllDaysMask is a bitmask of all the days of the week.
	AllDaysMask = 1<<uint(time.Sunday) | 1<<uint(time.Monday) | 1<<uint(time.Tuesday) | 1<<uint(time.Wednesday) | 1<<uint(time.Thursday) | 1<<uint(time.Friday) | 1<<uint(time.Saturday)
	// WeekDaysMask is a bitmask of all the weekdays of the week.
	WeekDaysMask = 1<<uint(time.Monday) | 1<<uint(time.Tuesday) | 1<<uint(time.Wednesday) | 1<<uint(time.Thursday) | 1<<uint(time.Friday)
	//WeekendDaysMask is a bitmask of the weekend days of the week.
	WeekendDaysMask = 1<<uint(time.Sunday) | 1<<uint(time.Saturday)
)

Variables

View Source
var (
	// DaysOfWeek are all the time.Weekday in an array for utility purposes.
	DaysOfWeek = []time.Weekday{
		time.Sunday,
		time.Monday,
		time.Tuesday,
		time.Wednesday,
		time.Thursday,
		time.Friday,
		time.Saturday,
	}

	// WeekDays are the business time.Weekday in an array.
	WeekDays = []time.Weekday{
		time.Monday,
		time.Tuesday,
		time.Wednesday,
		time.Thursday,
		time.Friday,
	}

	// WeekendDays are the weekend time.Weekday in an array.
	WeekendDays = []time.Weekday{
		time.Sunday,
		time.Saturday,
	}

	//Epoch is unix epoc saved for utility purposes.
	Epoch = time.Unix(0, 0)
)
View Source
var (
	// Date contains utility functions that operate on dates.
	Date = &date{}
)
View Source
var (
	// File contains file utility functions
	File = fileUtil{}
)
View Source
var (
	// Math contains helper methods for common math operations.
	Math = &mathUtil{}
)
View Source
var (
	// Time contains time utility functions.
	Time = timeUtil{}
)

Functions

func NASDAQClose

func NASDAQClose() time.Time

NASDAQClose is when NASDAQ closes.

func NASDAQOpen

func NASDAQOpen() time.Time

NASDAQOpen is when NASDAQ opens.

func NYSEArcaClose

func NYSEArcaClose() time.Time

NYSEArcaClose is when NYSEARCA closes.

func NYSEArcaOpen

func NYSEArcaOpen() time.Time

NYSEArcaOpen is when NYSEARCA opens.

func NYSEClose

func NYSEClose() time.Time

NYSEClose is when the NYSE closes.

func NYSEOpen

func NYSEOpen() time.Time

NYSEOpen is when the NYSE opens.

Types

type HolidayProvider

type HolidayProvider func(time.Time) bool

HolidayProvider is a function that returns if a given time falls on a holiday.

Jump to

Keyboard shortcuts

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