Documentation
¶
Index ¶
- func ToBlocks(text string) []notionapi.Block
- type Config
- func (c *Config) DeletePost(ctx context.Context, key string) error
- func (c *Config) GetClient() *notionapi.Client
- func (c *Config) GetPost(ctx context.Context, key string) (*Post, error)
- func (c *Config) GetPostFullContent(ctx context.Context, pageID string) (string, error)
- func (c *Config) ListPosts(ctx context.Context, count int) ([]*Post, error)
- func (c *Config) SaveEntry(ctx context.Context, text string) error
- func (c *Config) SearchPosts(ctx context.Context, query string, maxResults int) ([]*Post, error)
- func (c *Config) TimeSinceLastPost(ctx context.Context) (time.Duration, error)
- func (c *Config) UpdateCache(ctx context.Context) error
- type Post
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v0.1.0
type Config struct {
// contains filtered or unexported fields
}
Config holds the configuration for the client.
func (*Config) DeletePost ¶ added in v0.1.0
DeletePost deletes a journal entry.
func (*Config) GetPostFullContent ¶ added in v0.1.0
GetPostFullContent fetches the full content of a post by page ID
func (*Config) SearchPosts ¶ added in v0.1.0
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
TimeSinceLastPost returns the time since the last post was created.
type Post ¶
type Post struct {
// ID is the unique identifier of the post.
ID string
PageID string // Notion page ID for fetching full content
// Tags are the tags associated with the post.
Tags []string
// Text is the content of the post.
Text string
// CreatedAt is the time the post was created.
CreatedAt time.Time
// ModifiedAt is the time the post was last modified.
ModifiedAt time.Time
}
Post represents a journal entry.
Click to show internal directories.
Click to hide internal directories.