config

package
v0.0.0-...-3b3e90e Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: MIT

SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DayMinute

func DayMinute(t time.Time) int

Types

type Day

type Day struct {
	Minutes          DayMinutes
	DecentFrames     TimeFrames
	ClosestDecentDay time.Weekday
}

func (Day) String

func (d Day) String() string

type DayMinutes

type DayMinutes [1440]*TimeFrame

A list of day minutes that are work times

type HourMin

type HourMin struct {
	// contains filtered or unexported fields
}

type ParseDayError

type ParseDayError struct {
	Day time.Weekday
	// contains filtered or unexported fields
}

type RawScheduleConfig

type RawScheduleConfig struct {
	Days map[time.Weekday]string
}

func GetGitRawConfig

func GetGitRawConfig(options *map[string]string) (RawScheduleConfig, error)

func NewScheduleFromPlainText

func NewScheduleFromPlainText(plainText io.Reader) (*RawScheduleConfig, error)

func (*RawScheduleConfig) SetValue

func (config *RawScheduleConfig) SetValue(day string, value string) error

type Schedule

type Schedule struct {
	Days [7]Day
}

func NewScheduleFromMap

func NewScheduleFromMap(daysFrames map[string]string) (Schedule, error)

func NewScheduleFromRaw

func NewScheduleFromRaw(config *RawScheduleConfig) (Schedule, error)

func (*Schedule) ClosestDecentDay

func (s *Schedule) ClosestDecentDay(day time.Weekday) (time.Weekday, int)

func (*Schedule) ClosestDecentMinute

func (s *Schedule) ClosestDecentMinute(date time.Time) (int, int)

func (*Schedule) DecentTimeFrames

func (s *Schedule) DecentTimeFrames(day time.Weekday) []TimeFrame

func (*Schedule) HasDecentTimeframe

func (s *Schedule) HasDecentTimeframe(day time.Weekday) bool

func (Schedule) String

func (s Schedule) String() string

type TimeFrame

type TimeFrame struct {
	StartMinute int
	EndMinute   int
}

func (TimeFrame) String

func (t TimeFrame) String() string

type TimeFrames

type TimeFrames []TimeFrame

func (TimeFrames) String

func (t TimeFrames) String() string

Jump to

Keyboard shortcuts

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