Categorygithub.com/Samudai/go-notion
modulepackage
0.8.0
Repository: https://github.com/samudai/go-notion.git
Documentation: pkg.go.dev

# README

go-notion

GitHub tag (latest
SemVer) Test Go
Reference GitHub Go Report
Card

go-notion is a client for the Notion API, written in Go.

Features

The client supports all (non-deprecated) endpoints available in the Notion API, as of September 4, 2022:

Databases
Pages
Blocks
Users
Search
Comments

Installation

$ go get github.com/Samudai/go-notion

Usage

To obtain an API key, follow Notion’s getting started guide.

import "github.com/Samudai/go-notion"

(...)

client := notion.NewClient("secret-api-key")

page, err := client.FindPageByID(context.Background(), "18d35eb5-91f1-4dcb-85b0-c340fd965015")
if err != nil {
    // Handle error...
}

👉 Check out the docs on pkg.go.dev for a complete reference and the examples directory for more example code.

Status

The Notion API itself is out of beta. This library is updated periodically following documented changes from the Notion changelog.

Note: This library will make breaking changes in its code until v1.0 of the module is released. There are no immediate plans for a v1.0 release. I want the design choices to be solidified and battle-tested more before committing to a stable release (and the possible burden of a "v2+" Go module should I want to introduce breaking changes).

License

MIT License

© 2022 David Stotijn

# Packages

No description provided by the author

# Functions

BoolPtr returns the pointer of a bool value.
Float64Ptr returns the pointer of a float64 value.
No description provided by the author
IntPtr returns the pointer of an int value.
NewClient returns a new Client.
NewDateTime returns a new DateTime.
ParseDateTime parses an RFC3339 formatted string with optional time.
StringPtr returns the pointer of a string value.
TimePtr returns the pointer of a time.Time value.
WithHTTPClient overrides the default http.Client.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DateTimeFormat is used when calling time.Parse, using RFC3339 with microsecond precision, which is what the Notion API returns in JSON response data.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Used for paginated property values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Database property type enums.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Formula result type enums.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Number format enums.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Rollup result type enums.
No description provided by the author
No description provided by the author
Sort direction enums.
No description provided by the author
Sort timestamp enums.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

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

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
AuthResponse is the response from the notion authentication endpoint.
BaseUser contains the fields that are always returned for user objects.
BlockChildrenResponse contains results (block children) and pagination data returned from a find request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Client is used for HTTP requests to the Notion API.
No description provided by the author
No description provided by the author
No description provided by the author
Comment represents a comment on a Notion page or block.
No description provided by the author
CreateCommentParams are the params used for creating a comment.
CreateDatabaseParams are the params used for creating a database.
CreatePageParams are the params used for creating a page.
Database is a resource on the Notion platform.
No description provided by the author
No description provided by the author
DatabaseQuery is used for quering a database.
DatabaseQueryFilter is used to filter database contents.
No description provided by the author
DatabaseQueryResponse contains the results and pagination data from a query request.
No description provided by the author
No description provided by the author
No description provided by the author
DateTime represents a Notion date property with optional time.
No description provided by the author
No description provided by the author
No description provided by the author
Database property metadata types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FindCommentsByBlockIDQuery is used when listing comments.
FindCommentsResponse contains results (comments) and pagination data returned from a list request.
No description provided by the author
Database property metadata types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Icon has one non-nil Emoji or External field, denoted by the corresponding IconType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ListUsersResponse contains results (users) and pagination data returned from a list request.
No description provided by the author
No description provided by the author
NotionAuthPayload is the payload for the notion authentication endpoint.
NotionError is the error response from the Notion API.
No description provided by the author
No description provided by the author
Database property metadata types.
Owner is the owner of a notion workspace.
Page is a resource on the Notion platform.
PageProperties are properties of a page whose parent is a page or a workspace.
PagePropItem is used for a *single* property object value, e.g.
PagePropListItem describes the property returned in a paginated list response (e.g.
PagePropResponse contains a single database page property item or a list of items.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Database property metadata types.
No description provided by the author
No description provided by the author
Database property metadata types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Database property metadata types.
No description provided by the author
No description provided by the author
No description provided by the author
Database property metadata types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UpdateDatabaseParams are the params used for updating a database.
UpdatePageParams is used for updating a page.
No description provided by the author
No description provided by the author

# Interfaces

Block represents content on the Notion platform.

# Type aliases

No description provided by the author
No description provided by the author
ClientOption is used to override default client behavior.
No description provided by the author
DatabasePageProperties are properties of a page whose parent is a database.
DatabaseProperties is a mapping of properties defined on a database.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author