notion

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendBlockParams

type AppendBlockParams struct {
	// Child content to append to a container block as an array of block objects.
	Children []any `json:"children"`
}

type AppendBlockResponse

type AppendBlockResponse struct {
	Object  string  `json:"object"`
	Results []Block `json:"results"`
}

func AppendBlock

func AppendBlock(params AppendBlockParams) (result *AppendBlockResponse, err error)

type Block

type Block struct {
	// ID             BlockID    `json:"id,omitempty"`
	Object      string     `json:"object"`
	Type        string     `json:"type"`
	CreatedTime *time.Time `json:"created_time,omitempty"`
}

See https://developers.notion.com/reference/block

func (Block) GetCreatedTime

func (b Block) GetCreatedTime() *time.Time

func (Block) GetType

func (b Block) GetType() string

type BlockID

type BlockID string

type BlockInterface

type BlockInterface interface {
	GetType() Block
	GetCreatedTime() *time.Time
}

type Client

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

func NewClient

func NewClient() *Client

NewClient returns a new Notion API client.

type Config

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

type ErrorResponse

type ErrorResponse struct {
	Object  string `json:"object"`
	Status  int    `json:"status"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Paragraph

type Paragraph struct {
	RichText []RichText `json:"rich_text"`
	Children []Block    `json:"children,omitempty"`
	Color    string     `json:"color,omitempty"`
}

type ParagraphBlock

type ParagraphBlock struct {
	Block
	Paragraph Paragraph `json:"paragraph"`
}

type RichText

type RichText struct {
	Text      *Text  `json:"text,omitempty"`
	PlainText string `json:"plain_text,omitempty"`
}

type Text

type Text struct {
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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