client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBlocks added in v0.1.0

func ToBlocks(text string) []notionapi.Block

Types

type Config added in v0.1.0

type Config struct {
	// contains filtered or unexported fields
}

func New added in v0.1.0

func New(key string) (*Config, error)

func (*Config) DeletePost added in v0.1.0

func (c *Config) DeletePost(ctx context.Context, key string) error

func (*Config) GetClient added in v0.1.0

func (c *Config) GetClient() *notionapi.Client

func (*Config) GetPost added in v0.1.0

func (c *Config) GetPost(ctx context.Context, key string) (*Post, error)

func (*Config) GetPostFullContent added in v0.1.0

func (c *Config) GetPostFullContent(ctx context.Context, pageID string) (string, error)

GetPostFullContent fetches the full content of a post by page ID

func (*Config) ListPosts added in v0.1.0

func (c *Config) ListPosts(ctx context.Context, count int) ([]*Post, error)

func (*Config) SaveEntry added in v0.1.0

func (c *Config) SaveEntry(ctx context.Context, text string) error

func (*Config) SearchPosts added in v0.1.0

func (c *Config) SearchPosts(ctx context.Context, query string, maxResults int) ([]*Post, error)

SearchPosts uses Notion's native Search API to find matching pages, then fetches content only for those matches. This is much faster than fetching all pages and searching them locally.

func (*Config) TimeSinceLastPost added in v0.1.0

func (c *Config) TimeSinceLastPost(ctx context.Context) (time.Duration, error)

func (*Config) UpdateCache added in v0.1.0

func (c *Config) UpdateCache(ctx context.Context) error

type Post

type Post struct {
	ID         string
	PageID     string // Notion page ID for fetching full content
	Tags       []string
	Text       string
	CreatedAt  time.Time
	ModifiedAt time.Time
}

Jump to

Keyboard shortcuts

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