Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
ID string `json:"id"`
Type string `json:"type"`
// We flatten all block types into a generic map for URN scanning.
Paragraph *blockContent `json:"paragraph,omitempty"`
Heading1 *blockContent `json:"heading_1,omitempty"`
Heading2 *blockContent `json:"heading_2,omitempty"`
Heading3 *blockContent `json:"heading_3,omitempty"`
BulletedList *blockContent `json:"bulleted_list_item,omitempty"`
NumberedList *blockContent `json:"numbered_list_item,omitempty"`
Quote *blockContent `json:"quote,omitempty"`
Callout *blockContent `json:"callout,omitempty"`
Code *blockContent `json:"code,omitempty"`
}
Block represents a Notion block (used for reading page content).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Notion API.
func (*Client) GetBlockChildren ¶
GetBlockChildren returns the top-level blocks of a page or block.
func (*Client) SearchDatabases ¶
SearchDatabases returns all databases.
func (*Client) SearchPages ¶
SearchPages returns all pages, optionally filtered by query.
func (*Client) SetBaseURL ¶
SetBaseURL overrides the API base URL (used for testing).
type Config ¶
type Config struct {
Token string `json:"token" yaml:"token" mapstructure:"token" validate:"required"`
BaseURL string `json:"base_url" yaml:"base_url" mapstructure:"base_url" default:"https://api.notion.com"`
Extract []string `json:"extract" yaml:"extract" mapstructure:"extract" validate:"omitempty,dive,oneof=pages databases"`
}
type Database ¶
type Database struct {
ID string `json:"id"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
Title []RichText `json:"title"`
Description []RichText `json:"description"`
Archived bool `json:"archived"`
URL string `json:"url"`
Parent Parent `json:"parent"`
Properties map[string]any `json:"properties"`
}
Database represents a Notion database.
type Extractor ¶
type Extractor struct {
plugins.BaseExtractor
// contains filtered or unexported fields
}
type Page ¶
type Page struct {
ID string `json:"id"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
Archived bool `json:"archived"`
URL string `json:"url"`
Parent Parent `json:"parent"`
Properties map[string]any `json:"properties"`
}
Page represents a Notion page.
type Parent ¶
type Parent struct {
Type string `json:"type"`
PageID string `json:"page_id,omitempty"`
DatabaseID string `json:"database_id,omitempty"`
WorkspaceID string `json:"workspace,omitempty"`
}
Parent represents the parent of a page or database.
Click to show internal directories.
Click to hide internal directories.