configuration

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCalendars

func LoadCalendars(year int)

Types

type BHCalendar

type BHCalendar struct {
	DaysMaps map[string]BankHoliday // map[date 02-01-2006 format]
}

func (*BHCalendar) IsDateBankHoliday

func (b *BHCalendar) IsDateBankHoliday(date time.Time) bool

func (*BHCalendar) IsWeekend

func (b *BHCalendar) IsWeekend(date time.Time) bool

type BHCalendars

type BHCalendars map[string]BHCalendar // map[calendar_name-year]
var BankHolidaysCalendars BHCalendars

type BankHoliday

type BankHoliday struct {
	Name string `yaml:"title,omitempty"`
	Date Day    `yaml:"date,omitempty"`
}

type Configuration

type Configuration struct {
	PdAuthToken           string
	RotationInfo          RotationInfo
	RotationExcludedHours []RotationExcludedHoursDay
	RotationPrices        RotationPrices
	RotationUsers         []RotationUser
	SchedulesToIgnore     []string
	// contains filtered or unexported fields
}

func New

func New() *Configuration

func (*Configuration) FindPriceByDay

func (c *Configuration) FindPriceByDay(dayType string) (*int, error)

func (*Configuration) FindRotationExcludedHoursByDay added in v1.2.0

func (c *Configuration) FindRotationExcludedHoursByDay(dayType string) (*RotationExcludedHoursDay, error)

func (*Configuration) FindRotationUserInfoByID

func (c *Configuration) FindRotationUserInfoByID(userID string) (*RotationUser, error)

func (*Configuration) IsScheduleIDToIgnore

func (c *Configuration) IsScheduleIDToIgnore(scheduleID string) bool

type Day

type Day struct {
	Time *time.Time
}

func (*Day) ToHashKey

func (d *Day) ToHashKey() string

func (*Day) UnmarshalYAML

func (d *Day) UnmarshalYAML(unmarshal func(interface{}) error) error

type RotationExcludedHoursDay added in v1.2.0

type RotationExcludedHoursDay struct {
	Day              string
	ExcludedStartsAt int
	ExcludedEndsAt   int
}

type RotationInfo added in v1.2.0

type RotationInfo struct {
	DailyRotationStartsAt    int
	CheckRotationChangeEvery int
}

type RotationPriceDay added in v1.2.0

type RotationPriceDay struct {
	Day   string
	Price int
}

type RotationPrices added in v1.2.0

type RotationPrices struct {
	Currency string
	DaysInfo []RotationPriceDay
}

type RotationUser

type RotationUser struct {
	UserID           string
	Name             string
	HolidaysCalendar string
}

Jump to

Keyboard shortcuts

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