notionclient

package
v0.0.0-...-79350a0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PAGE_SIZE = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockID

type BlockID string

type DatabaseID

type DatabaseID string

type DatabaseName

type DatabaseName string

type NotionApiClient

type NotionApiClient struct {
	Client *notionapi.Client
}

func (*NotionApiClient) AppendBlocksToBlock

Add subblocks to given block ID

func (*NotionApiClient) AppendBlocksToPage

Add blocks to given page ID

func (*NotionApiClient) CreateDatabase

Create a database object

func (*NotionApiClient) CreatePage

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

func (c *NotionApiClient) GetBlockByID(ctx context.Context,
	id BlockID) (notionapi.Block, error)

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

func (c *NotionApiClient) GetPageByID(ctx context.Context,
	id PageID) (*notionapi.Page, error)

Get Page with given PageID

func (*NotionApiClient) GetPagesByName

func (c *NotionApiClient) GetPagesByName(ctx context.Context, name PageName,
	cursor notionapi.Cursor) ([]notionapi.Page, notionapi.Cursor, error)

Get all pages matching the given page name

type NotionClient

func GetNotionApiClient

func GetNotionApiClient(ctx context.Context, token notionapi.Token,
	newClient NewClient) NotionClient

Function to get NotionApiClient instance

type PageID

type PageID string

type PageName

type PageName string

type Token

type Token string

Jump to

Keyboard shortcuts

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