client

package
v0.0.0-...-3b637fb Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONSchema string

Functions

This section is empty.

Types

type Client

type Client struct {
	Spec   Spec
	Notion *NotionClient
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, logger zerolog.Logger, s *Spec) (Client, error)

func (Client) ID

func (Client) ID() string

func (*Client) Logger

func (c *Client) Logger() *zerolog.Logger

type Error

type Error struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type NotionClient

type NotionClient struct {
	BaseURL       string
	Client        *http.Client
	AuthToken     string
	NotionVersion string
}

func NewNotionClient

func NewNotionClient(authToken string, notionVersion string) (*NotionClient, error)

func (*NotionClient) GetDatabases

func (c *NotionClient) GetDatabases(nextCursor string, hasMore bool) (*databases.Databases, error)

func (*NotionClient) GetPages

func (c *NotionClient) GetPages(nextCursor string, hasMore bool) (*pages.Pages, error)

func (*NotionClient) GetUsers

func (c *NotionClient) GetUsers(nextCursor string, hasMore bool) (*users.Users, error)

type Spec

type Spec struct {
	BearerToken   string `json:"bearer_token" jsonschema:"required,minLength=1"`
	NotionVersion string `json:"notion_version,omitempty" jsonschema:"minLength=1,default=2022-02-22"`
}

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

Directories

Path Synopsis
spec
gen

Jump to

Keyboard shortcuts

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