Documentation
¶
Index ¶
- Constants
- type BlockID
- type DatabaseID
- type DatabaseName
- type NewClient
- type NotionApiClient
- func (c *NotionApiClient) AppendBlocksToBlock(ctx context.Context, blockID BlockID, ...) (*notionapi.AppendBlockChildrenResponse, error)
- func (c *NotionApiClient) AppendBlocksToPage(ctx context.Context, pageID PageID, req *notionapi.AppendBlockChildrenRequest) (*notionapi.AppendBlockChildrenResponse, error)
- func (c *NotionApiClient) CreateDatabase(ctx context.Context, req *notionapi.DatabaseCreateRequest) (*notionapi.Database, error)
- func (c *NotionApiClient) CreatePage(ctx context.Context, req *notionapi.PageCreateRequest) (*notionapi.Page, error)
- func (c *NotionApiClient) GetAllDatabases(ctx context.Context, cursor notionapi.Cursor) ([]notionapi.Database, notionapi.Cursor, error)
- func (c *NotionApiClient) GetAllPages(ctx context.Context, cursor notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)
- func (c *NotionApiClient) GetBlockByID(ctx context.Context, id BlockID) (notionapi.Block, error)
- func (c *NotionApiClient) GetChildBlocksOfBlock(ctx context.Context, id BlockID, cursor notionapi.Cursor) ([]notionapi.Block, notionapi.Cursor, error)
- func (c *NotionApiClient) GetDatabaseByID(ctx context.Context, id DatabaseID) (*notionapi.Database, error)
- func (c *NotionApiClient) GetDatabasePages(ctx context.Context, id DatabaseID, cursor notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)
- func (c *NotionApiClient) GetDatabasesByName(ctx context.Context, name DatabaseName, cursor notionapi.Cursor) ([]notionapi.Database, notionapi.Cursor, error)
- func (c *NotionApiClient) GetPageBlocks(ctx context.Context, id PageID, cursor notionapi.Cursor) ([]notionapi.Block, notionapi.Cursor, error)
- func (c *NotionApiClient) GetPageByID(ctx context.Context, id PageID) (*notionapi.Page, error)
- func (c *NotionApiClient) GetPagesByName(ctx context.Context, name PageName, cursor notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)
- type NotionClient
- type PageID
- type PageName
- type Token
Constants ¶
View Source
const (
DEFAULT_PAGE_SIZE = 100
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseID ¶
type DatabaseID string
type DatabaseName ¶
type DatabaseName string
type NotionApiClient ¶
func (*NotionApiClient) AppendBlocksToBlock ¶
func (c *NotionApiClient) AppendBlocksToBlock(ctx context.Context, blockID BlockID, req *notionapi.AppendBlockChildrenRequest) ( *notionapi.AppendBlockChildrenResponse, error)
Add subblocks to given block ID
func (*NotionApiClient) AppendBlocksToPage ¶
func (c *NotionApiClient) AppendBlocksToPage(ctx context.Context, pageID PageID, req *notionapi.AppendBlockChildrenRequest) ( *notionapi.AppendBlockChildrenResponse, error)
Add blocks to given page ID
func (*NotionApiClient) CreateDatabase ¶
func (c *NotionApiClient) CreateDatabase(ctx context.Context, req *notionapi.DatabaseCreateRequest) (*notionapi.Database, error)
Create a database object
func (*NotionApiClient) CreatePage ¶
func (c *NotionApiClient) CreatePage(ctx context.Context, req *notionapi.PageCreateRequest) (*notionapi.Page, error)
Create a page object
func (*NotionApiClient) GetAllDatabases ¶
func (c *NotionApiClient) GetAllDatabases(ctx context.Context, cursor notionapi.Cursor) ([]notionapi.Database, notionapi.Cursor, error)
Get all databases. Passing empty name would mean fetching all the databases from workspace
func (*NotionApiClient) GetAllPages ¶
func (c *NotionApiClient) GetAllPages(ctx context.Context, cursor notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)
Get all pages. Passing empty name would mean fetching all the pages from workspace
func (*NotionApiClient) GetBlockByID ¶
Get block having given ID
func (*NotionApiClient) GetChildBlocksOfBlock ¶
func (c *NotionApiClient) GetChildBlocksOfBlock(ctx context.Context, id BlockID, cursor notionapi.Cursor) ([]notionapi.Block, notionapi.Cursor, error)
Get all child blocks of given block
func (*NotionApiClient) GetDatabaseByID ¶
func (c *NotionApiClient) GetDatabaseByID(ctx context.Context, id DatabaseID) (*notionapi.Database, error)
Get Database with given DatabaseID
func (*NotionApiClient) GetDatabasePages ¶
func (c *NotionApiClient) GetDatabasePages(ctx context.Context, id DatabaseID, cursor notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)
Get all pages for given Database
func (*NotionApiClient) GetDatabasesByName ¶
func (c *NotionApiClient) GetDatabasesByName(ctx context.Context, name DatabaseName, cursor notionapi.Cursor) ([]notionapi.Database, notionapi.Cursor, error)
Get all databases matching the given page name
func (*NotionApiClient) GetPageBlocks ¶
func (c *NotionApiClient) GetPageBlocks(ctx context.Context, id PageID, cursor notionapi.Cursor) ([]notionapi.Block, notionapi.Cursor, error)
Get all child blocks of given page
func (*NotionApiClient) GetPageByID ¶
Get Page with given PageID
type NotionClient ¶
type NotionClient interface {
GetAllPages(context.Context, notionapi.Cursor) ([]notionapi.Page,
notionapi.Cursor, error)
GetAllDatabases(context.Context, notionapi.Cursor) ([]notionapi.Database,
notionapi.Cursor, error)
GetPagesByName(context.Context, PageName, notionapi.Cursor) ([]notionapi.Page,
notionapi.Cursor, error)
GetDatabasesByName(context.Context, DatabaseName,
notionapi.Cursor) ([]notionapi.Database, notionapi.Cursor, error)
GetPageByID(context.Context, PageID) (*notionapi.Page, error)
GetDatabaseByID(context.Context, DatabaseID) (*notionapi.Database, error)
GetDatabasePages(context.Context, DatabaseID,
notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)
GetPageBlocks(context.Context, PageID, notionapi.Cursor) ([]notionapi.Block,
notionapi.Cursor, error)
GetChildBlocksOfBlock(context.Context, BlockID,
notionapi.Cursor) ([]notionapi.Block, notionapi.Cursor, error)
GetBlockByID(context.Context, BlockID) (notionapi.Block, error)
CreatePage(context.Context, *notionapi.PageCreateRequest) (*notionapi.Page,
error)
CreateDatabase(context.Context, *notionapi.DatabaseCreateRequest) (
*notionapi.Database, error)
AppendBlocksToPage(context.Context, PageID,
*notionapi.AppendBlockChildrenRequest) (
*notionapi.AppendBlockChildrenResponse, error)
AppendBlocksToBlock(context.Context, BlockID,
*notionapi.AppendBlockChildrenRequest) (
*notionapi.AppendBlockChildrenResponse, error)
}
func GetNotionApiClient ¶
func GetNotionApiClient(ctx context.Context, token notionapi.Token, newClient NewClient) NotionClient
Function to get NotionApiClient instance
Click to show internal directories.
Click to hide internal directories.