remind

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	// should be now() in most cases, but this field is useful for testing purposes
	Today    time.Time
	InNbDays int
	// when false, check birthdays which matches exactly Today + InNbDays
	// when true, check birthdays which matches every days between Today and Today + InNbDays
	Inclusive bool
}

Params holds remind context and conditions passed to the app as parameters

func (Params) RemindDay

func (r Params) RemindDay() time.Time

RemindDay returns the day to remind

type Reminder

type Reminder struct {
	Contacts     []contact.Contact
	RemindParams Params
}

Reminder contains business logic between Params and Contacts

func (Reminder) ContactsToRemind

func (r Reminder) ContactsToRemind() []contact.Contact

ContactsToRemind filters every contacts which the bday matches the reminder's conditions.

Jump to

Keyboard shortcuts

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