Documentation
¶
Index ¶
- Constants
- Variables
- func Init() error
- func New(services *types.OutreachServices, channels []chan string, raw any) (types.OutreachMessage, error)
- func NotionDailyDigest() string
- func NotionInit() error
- func NotionMorningAffirmations() string
- func NotionNightAffirmations() string
- func Ping() string
- type Event
- type NotionDatabase
- type StaticOutreachMessage
Constants ¶
View Source
const DIGEST_ERROR_LIMIT = 10
Variables ¶
View Source
var CRITICAL_TASKS = NotionDatabase{ ID: os.Getenv("NOTION_DATABASE_TASKS_ID"), Query: notionapi.DatabaseQuery{ Filter: ¬ionapi.DatabaseQueryFilter{ And: []notionapi.DatabaseQueryFilter{ { Property: "Priority", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Select: ¬ionapi.SelectDatabaseQueryFilter{ Equals: "Critical", }, }, }, { Property: "Canceled", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Formula: ¬ionapi.FormulaDatabaseQueryFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(false), }, }, }, }, { Property: "Complete", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(false), }, }, }, }, }, Sorts: []notionapi.DatabaseQuerySort{ { Property: "Effort", Direction: notionapi.SortDirDesc, }, }, }, }
View Source
var MORNING_AFFIRMATIONS_PAGE = os.Getenv("NOTION_PAGE_MORNING_AFFIRMATIONS")
View Source
var NIGHT_AFFIRMATIONS_PAGE = os.Getenv("NOTION_PAGE_NIGHT_AFFIRMATIONS")
View Source
var NORMAL_TASKS = NotionDatabase{ ID: os.Getenv("NOTION_DATABASE_TASKS_ID"), Query: notionapi.DatabaseQuery{ Filter: ¬ionapi.DatabaseQueryFilter{ And: []notionapi.DatabaseQueryFilter{ { Property: "Complete", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(false), }, }, }, { Property: "Canceled", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Formula: ¬ionapi.FormulaDatabaseQueryFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(false), }, }, }, }, { Property: "Priority", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Select: ¬ionapi.SelectDatabaseQueryFilter{ DoesNotEqual: "Critical", }, }, }, { Or: []notionapi.DatabaseQueryFilter{ { Property: "Rank", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Formula: ¬ionapi.FormulaDatabaseQueryFilter{ Number: ¬ionapi.NumberDatabaseQueryFilter{ GreaterThanOrEqualTo: intPointer(5), }, }, }, }, { Property: "Date", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Date: ¬ionapi.DatePropertyFilter{ NextWeek: &struct{}{}, }, }, }, { Property: "Date", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Date: ¬ionapi.DatePropertyFilter{ OnOrBefore: timePointer(time.Now()), }, }, }, }, }, }, }, Sorts: []notionapi.DatabaseQuerySort{ { Property: "Date", Direction: notionapi.SortDirAsc, }, }, }, }
View Source
var RECURRING_TASKS = NotionDatabase{ ID: os.Getenv("NOTION_DATABASE_RECURRING_ID"), Query: notionapi.DatabaseQuery{ Filter: ¬ionapi.DatabaseQueryFilter{ And: []notionapi.DatabaseQueryFilter{ { Property: "Active", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(true), }, }, }, { Property: "Upcoming", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Formula: ¬ionapi.FormulaDatabaseQueryFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(true), }, }, }, }, { Property: "Done", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(false), }, }, }, { Property: "Type", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Select: ¬ionapi.SelectDatabaseQueryFilter{ Equals: "", }, }, }, }, }, Sorts: []notionapi.DatabaseQuerySort{ { Property: "Name", Direction: notionapi.SortDirAsc, }, }, }, }
View Source
var SCHEDULE_ITEMS = NotionDatabase{ ID: os.Getenv("NOTION_DATABASE_SCHEDULE_ID"), Query: notionapi.DatabaseQuery{ Filter: ¬ionapi.DatabaseQueryFilter{ Property: "Day", DatabaseQueryPropertyFilter: notionapi.DatabaseQueryPropertyFilter{ Formula: ¬ionapi.FormulaDatabaseQueryFilter{ Checkbox: ¬ionapi.CheckboxDatabaseQueryFilter{ Equals: boolPointer(true), }, }, }, }, Sorts: []notionapi.DatabaseQuerySort{ { Property: "Date", Direction: notionapi.SortDirAsc, }, }, }, }
Functions ¶
func New ¶
func New(services *types.OutreachServices, channels []chan string, raw any) (types.OutreachMessage, error)
New creates a new static message (we don't save these to a DB because they're statically called in implementations)
func NotionDailyDigest ¶
func NotionDailyDigest() string
NotionDailyDigest formats a long, digest string for the user to read with tons of information from Notion
func NotionInit ¶
func NotionInit() error
func NotionMorningAffirmations ¶
func NotionMorningAffirmations() string
NotionMorningAffirmations returns the morning affirmations stored in Notion
func NotionNightAffirmations ¶
func NotionNightAffirmations() string
NotionNightAffirmations returns the night affirmations stored in Notion
Types ¶
type NotionDatabase ¶
type NotionDatabase struct { ID string Query notionapi.DatabaseQuery }
NotionDatabase type holds a database ID and query to get the database with
type StaticOutreachMessage ¶
type StaticOutreachMessage struct { Function func() string // The function that will be called repeatedly Channels []chan string // Channels that Horus will send the response to Repeat string // The cron string used to repeat calls // contains filtered or unexported fields }
StaticOutreachMessage represents a statically sent message to the user. Static messages repeat on a given interval supplied by a CRON string by calling a custom-built function
func (*StaticOutreachMessage) Delete ¶
func (m *StaticOutreachMessage) Delete() error
func (*StaticOutreachMessage) GetChannels ¶
func (m *StaticOutreachMessage) GetChannels() []chan string
func (*StaticOutreachMessage) GetContent ¶
func (m *StaticOutreachMessage) GetContent() string
func (*StaticOutreachMessage) Start ¶
func (m *StaticOutreachMessage) Start() error
func (*StaticOutreachMessage) Stop ¶
func (m *StaticOutreachMessage) Stop() error
Click to show internal directories.
Click to hide internal directories.