protos

package
v0.0.0-...-53cc070 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// housekeeping
	PROTO_VERSION rune = '1'
	PROTO_SIZE    int  = 9

	// indices
	VERSION_INDEX            int = 0
	CADENCE_INDEX            int = 1
	START_DAYS_OF_WEEK_INDEX int = 2
	END_DAYS_OF_WEEK_INDEX   int = 9
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cadence

type Cadence int
const (
	Weekly Cadence = iota
	Biweekly
	Monthly
)

type HappensOn

type HappensOn func(Recurrence) Recurrence

type Occurrence

type Occurrence struct {
	Start time.Time
	End   time.Time
}

type Recurrence

type Recurrence struct {
	Cadence            Cadence
	HappensOnMonday    bool
	HappensOnTuesday   bool
	HappensOnWednesday bool
	HappensOnThursday  bool
	HappensOnFriday    bool
	HappensOnSaturday  bool
	HappensOnSunday    bool
}

func Friday

func Friday(r Recurrence) Recurrence

func Monday

func Monday(r Recurrence) Recurrence

func NewRecurrence

func NewRecurrence(cadence Cadence, happensOn ...HappensOn) (*Recurrence, error)

func RecurrenceFrom

func RecurrenceFrom(raw StringRecurrence) (recurrence *Recurrence, err error)

func Saturday

func Saturday(r Recurrence) Recurrence

func Sunday

func Sunday(r Recurrence) Recurrence

func Thursday

func Thursday(r Recurrence) Recurrence

func Tuesday

func Tuesday(r Recurrence) Recurrence

func Wednesday

func Wednesday(r Recurrence) Recurrence

func (*Recurrence) HappensOn

func (r *Recurrence) HappensOn() []time.Weekday

func (*Recurrence) Into

func (r *Recurrence) Into() string

func (*Recurrence) ReccurUntil

func (r *Recurrence) ReccurUntil(start time.Time, end time.Time, termination time.Time) (result []Occurrence, err error)

type StringRecurrence

type StringRecurrence string

PROTO v1 0: [proto version] 1: [cadence] 2: [does this occur on Monday?] 3: [does this occur on Tuesday?] 4: [does this occur on Wednesday?] 5: [does this occur on Thursday?] 6: [does this occur on Friday?] 7: [does this occur on Saturday?] 8: [does this occur on Sunday?]

Jump to

Keyboard shortcuts

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