notion

package
v0.0.0-...-a602de9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeByName

func GetTimeByName(tags []string, utcTime time.Time) (res *time.Time)

func NewFakeNotion

func NewFakeNotion(t *testing.T) *rawClient

NewFakeNotion makes a fake

Types

type Client

type Client interface {
	GetAll(ctx context.Context, lookback time.Duration, pageID string) ([]Recipe, error)
}

func New

func New(token, database string) Client

New makes a notion client

type Photo

type Photo struct {
	BlockID string `json:"block_id,omitempty"`
	URL     string `json:"url,omitempty"`
}

Photo holds a photo from notion

type Recipe

type Recipe struct {
	Title     string     `json:"title,omitempty"`
	Time      *time.Time `json:"time,omitempty"`
	Tags      []string   `json:"tags,omitempty"`
	Photos    []Photo    `json:"photos,omitempty"`
	PageID    string     `json:"page_id,omitempty"`
	NotionURL string     `json:"notion_url,omitempty"`
	SourceURL string     `json:"source_url,omitempty"`
	UID       string     `json:"unique_id,omitempty"`
	Raw       string     `json:"raw,omitempty"`
	Children  []Recipe   `json:"children,omitempty"`
	Debug     []string   `json:"debug,omitempty"`
	Scale     *float64   `json:"scale,omitempty"`
}

Recipe holds notion recipe page

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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