Documentation
¶
Index ¶
- func ExtractPageIDFromURL(urlOrID string) string
- type BlockWithChildren
- type Client
- func (c *Client) CreatePage(ctx context.Context, req *CreatePageRequest) (*notionapi.Page, error)
- func (c *Client) GetAllBlocksRecursive(ctx context.Context, pageID string) ([]BlockWithChildren, error)
- func (c *Client) GetPage(ctx context.Context, pageID string) (*notionapi.Page, error)
- func (c *Client) GetPageChildren(ctx context.Context, pageID string) ([]notionapi.Block, error)
- func (c *Client) GetPageTitle(ctx context.Context, pageID string) (string, error)
- func (c *Client) UpdatePage(ctx context.Context, req *UpdatePageRequest) (*notionapi.Page, error)
- type CreatePageRequest
- type UpdatePageRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPageIDFromURL ¶
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 (*Client) CreatePage ¶
CreatePage 新しいページを作成
func (*Client) GetAllBlocksRecursive ¶ added in v0.2.0
func (c *Client) GetAllBlocksRecursive(ctx context.Context, pageID string) ([]BlockWithChildren, error)
GetAllBlocksRecursive ページの全ブロックを再帰的に取得
func (*Client) GetPageChildren ¶
GetPageChildren ページの子ブロックを取得
func (*Client) GetPageTitle ¶ added in v0.2.0
GetPageTitle ページのタイトルを取得
func (*Client) UpdatePage ¶
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 ページ更新リクエスト
Click to show internal directories.
Click to hide internal directories.