notion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPageIDFromURL

func ExtractPageIDFromURL(urlOrID string) string

ExtractPageIDFromURL Notion URLからページIDを抽出

Types

type BlockWithChildren added in v0.2.0

type BlockWithChildren struct {
	Block    notionapi.Block
	Children []BlockWithChildren
}

BlockWithChildren ブロックとその子ブロックを保持する構造体

type Client

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

Client Notion APIクライアントのラッパー

func NewClient

func NewClient(apiKey string) *Client

NewClient 新しいNotionクライアントを作成

func (*Client) CreatePage

func (c *Client) CreatePage(ctx context.Context, req *CreatePageRequest) (*notionapi.Page, error)

CreatePage 新しいページを作成

func (*Client) GetAllBlocksRecursive added in v0.2.0

func (c *Client) GetAllBlocksRecursive(ctx context.Context, pageID string) ([]BlockWithChildren, error)

GetAllBlocksRecursive ページの全ブロックを再帰的に取得

func (*Client) GetPage

func (c *Client) GetPage(ctx context.Context, pageID string) (*notionapi.Page, error)

GetPage ページを取得

func (*Client) GetPageChildren

func (c *Client) GetPageChildren(ctx context.Context, pageID string) ([]notionapi.Block, error)

GetPageChildren ページの子ブロックを取得

func (*Client) GetPageTitle added in v0.2.0

func (c *Client) GetPageTitle(ctx context.Context, pageID string) (string, error)

GetPageTitle ページのタイトルを取得

func (*Client) UpdatePage

func (c *Client) UpdatePage(ctx context.Context, req *UpdatePageRequest) (*notionapi.Page, error)

UpdatePage 既存のページを更新

type CreatePageRequest

type CreatePageRequest struct {
	Parent     notionapi.Parent              // 親ページ
	Title      string                        // ページタイトル
	Children   []notionapi.Block             // 子ブロック
	Icon       *notionapi.Icon               // アイコン(オプション)
	Cover      *notionapi.Image              // カバー画像(オプション)
	Properties map[string]notionapi.Property // 追加プロパティ(オプション)
}

CreatePageRequest ページ作成リクエスト

type UpdatePageRequest

type UpdatePageRequest struct {
	PageID     string                        // ページID
	Title      string                        // ページタイトル
	Children   []notionapi.Block             // 子ブロック(既存ブロックは削除)
	Icon       *notionapi.Icon               // アイション(オプション)
	Cover      *notionapi.Image              // カバー画像(オプション)
	Properties map[string]notionapi.Property // 追加プロパティ(オプション)
}

UpdatePageRequest ページ更新リクエスト

Jump to

Keyboard shortcuts

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