repository

package
v0.0.0-...-ae7e3a8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func QueryNotionUser

func QueryNotionUser(client *notionapi.Client, username string, timeout time.Duration) (notionapi.User, error)

QueryNotionUser find user in Notion by user name. Returns ErrNotFound if user not found.

Types

type CalendarRepository

type CalendarRepository struct {
	Name    string
	Service *calendar.Service
	Cfg     *config.GoogleCalendarConfig
}

func NewCalendarRepository

func NewCalendarRepository(name string, cfg *config.GoogleCalendarConfig) (*CalendarRepository, error)

func (*CalendarRepository) GetEvents

func (r *CalendarRepository) GetEvents(cfg *config.Config, sc *models.SearchConfig) (doneEvents models.Events, todayEvents models.Events, err error)

type NotionRepository

type NotionRepository struct {
	Client *notionapi.Client
	Cfg    *config.NotionConfig
	Name   string
}

func NewNotionRepository

func NewNotionRepository(name string, cfg *config.NotionConfig) (*NotionRepository, error)

func (*NotionRepository) GetNotes

func (r *NotionRepository) GetNotes(page *notionapi.Page, searchTimeStart time.Time, headingName string, taskCh chan models.Task, wg *sync.WaitGroup, done chan struct{})

GetNotes

func (*NotionRepository) GetPages

func (r *NotionRepository) GetPages() (output []notionapi.Page, err error)

GetPages returns pages from database which has property Assign equals to user

func (*NotionRepository) GetTasks

func (r *NotionRepository) GetTasks(cfg *config.Config, sc *models.SearchConfig) (doneTasks models.Tasks, todayTasks models.Tasks, err error)

func (*NotionRepository) SearchHeading

func (r *NotionRepository) SearchHeading(blockID notionapi.BlockID, searchTime time.Time, name string) (notionapi.Block, error)

func (*NotionRepository) SearchNotes

func (r *NotionRepository) SearchNotes(blockID notionapi.BlockID, searchTime time.Time) ([]string, error)

type Repository

type Repository interface {
	GetTasks(cfg config.Config, sc models.SearchConfig)
}

Jump to

Keyboard shortcuts

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