Documentation
¶
Index ¶
- func BlocksToMarkdown(blocks []notionBlock) string
- type Client
- func (c *Client) GetPage(ctx context.Context, pageID string) (string, error)
- func (c *Client) ListDatabases(ctx context.Context) ([]DatabaseEntry, error)
- func (c *Client) QueryDatabase(ctx context.Context, dbID string) ([]DatabaseRow, error)
- func (c *Client) Search(ctx context.Context, query string) ([]SearchResult, error)
- func (c *Client) SetHTTPDoer(doer apiclient.HTTPDoer)
- type Config
- type DatabaseEntry
- type DatabaseRow
- type Instance
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlocksToMarkdown ¶
func BlocksToMarkdown(blocks []notionBlock) string
BlocksToMarkdown converts a slice of Notion blocks to a markdown string.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Notion API client.
func (*Client) ListDatabases ¶
func (c *Client) ListDatabases(ctx context.Context) ([]DatabaseEntry, error)
ListDatabases lists all databases shared with the integration.
func (*Client) QueryDatabase ¶
QueryDatabase queries a Notion database and returns its rows.
func (*Client) Search ¶
Search searches the Notion workspace for pages and databases matching the query.
func (*Client) SetHTTPDoer ¶
SetHTTPDoer replaces the HTTP client used for API requests.
type Config ¶
type Config struct {
Name string `mapstructure:"name"`
URL string `mapstructure:"url"`
Token string `mapstructure:"token"`
Description string `mapstructure:"description"`
}
Config holds the configuration for a single Notion instance.
func LoadConfigs ¶
LoadConfigs reads a .humanconfig YAML file from dir and returns the list of configured Notion instances. Returns nil and no error if the file does not exist.
type DatabaseEntry ¶
type DatabaseEntry struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
}
DatabaseEntry is a database listing entry for CLI output.
type DatabaseRow ¶
type DatabaseRow struct {
ID string `json:"id"`
URL string `json:"url"`
Properties map[string]string `json:"properties"`
}
DatabaseRow is a single row from a database query for CLI output.
type Instance ¶
Instance represents a configured Notion workspace ready for use.
func LoadInstances ¶
LoadInstances reads config, applies env overrides, creates clients, and returns ready-to-use Notion instances.