src

package
v0.0.0-...-b5d429a Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchBoard

func FetchBoard(client *http.Client, id string, key string) (QueryResult, Database)

func InsertPage

func InsertPage(client *http.Client, newPage PageRequest, id string, key string)

func PrintBoard

func PrintBoard(qr QueryResult, db Database)

Types

type Database

type Database struct {
	Object string `json:"object"`
	Id     string `json:"Id"`
	Icon   struct {
		Type  string `json:"type"`
		Emoji string `json:"emoji"`
	} `json:"icon"`
	CreatedTime time.Time `json:"created_time"`
	CreatedBy   struct {
		Object string `json:"object"`
		Id     string `json:"Id"`
	} `json:"created_by"`
	LastEditedBy struct {
		Object string `json:"object"`
		Id     string `json:"Id"`
	} `json:"last_edited_by"`
	LastEditedTime time.Time `json:"last_edited_time"`
	Title          []struct {
		Type string `json:"type"`
		Text struct {
			Content string `json:"content"`
			Link    string `json:"link"`
		} `json:"text"`
		Annotations struct {
			Bold          bool   `json:"bold"`
			Italic        bool   `json:"italic"`
			Strikethrough bool   `json:"strikethrough"`
			Underline     bool   `json:"underline"`
			Code          bool   `json:"code"`
			Color         string `json:"color"`
		} `json:"annotations"`
		PlainText string `json:"plain_text"`
		Href      string `json:"href"`
	} `json:"title"`
	Description []string `json:"description"`
	IsInline    bool     `json:"is_inline"`
	Properties  struct {
		Status struct {
			Id     string `json:"Id"`
			Name   string `json:"name"`
			Type   string `json:"type"`
			Status struct {
				Options []struct {
					Id    string `json:"Id"`
					Name  string `json:"name"`
					Color string `json:"color"`
				} `json:"options"`
				Groups []struct {
					Id        string   `json:"Id"`
					Name      string   `json:"name"`
					Color     string   `json:"color"`
					OptionIds []string `json:"option_Ids"`
				} `json:"groups"`
			} `json:"status"`
		} `json:"Status"`
		Assign struct {
			Id     string `json:"Id"`
			Name   string `json:"name"`
			Type   string `json:"type"`
			People struct {
			} `json:"people"`
		} `json:"Assign"`
		Name struct {
			Id    string `json:"Id"`
			Name  string `json:"name"`
			Type  string `json:"type"`
			Title struct {
			} `json:"title"`
		} `json:"Name"`
	} `json:"properties"`
	Parent struct {
		Type      string `json:"type"`
		Workspace bool   `json:"workspace"`
	} `json:"parent"`
	Url      string `json:"url"`
	Archived bool   `json:"archived"`
}

func FetchDatabase

func FetchDatabase(client *http.Client, id string, key string) (Database, error)

type Filter

type Filter struct {
	Property string `json:"property"`
	Status   Status `json:"status"`
}

type FilterPages

type FilterPages struct {
	Filter Filter `json:"filter"`
}

type Name

type Name struct {
	Title []Title `json:"title"`
}

type PageRequest

type PageRequest struct {
	Parent     Parent     `json:"parent"`
	Properties Properties `json:"properties"`
}

type Parent

type Parent struct {
	DatabaseId string `json:"database_id"`
}

type Properties

type Properties struct {
	Name Name `json:"Name"`
}

type QueryResult

type QueryResult struct {
	Object  string `json:"object"`
	Results []struct {
		Object         string    `json:"object"`
		Id             string    `json:"Id"`
		CreatedTime    time.Time `json:"created_time"`
		LastEditedTime time.Time `json:"last_edited_time"`
		CreatedBy      struct {
			Object string `json:"object"`
			Id     string `json:"Id"`
		} `json:"created_by"`
		LastEditedBy struct {
			Object string `json:"object"`
			Id     string `json:"Id"`
		} `json:"last_edited_by"`
		Parent struct {
			Type       string `json:"type"`
			DatabaseId string `json:"database_Id"`
		} `json:"parent"`
		Archived   bool `json:"archived"`
		Properties struct {
			State struct {
				Id     string `json:"Id"`
				Type   string `json:"type"`
				Status struct {
					Id    string `json:"Id"`
					Name  string `json:"name"`
					Color string `json:"color"`
				} `json:"status"`
			} `json:"State"`
			Assign struct {
				Id     string   `json:"Id"`
				Type   string   `json:"type"`
				People []string `json:"people"`
			} `json:"Assign"`
			Name struct {
				Id    string `json:"Id"`
				Type  string `json:"type"`
				Title []struct {
					Type string `json:"type"`
					Text struct {
						Content string `json:"content"`
						Link    string `json:"link"`
					} `json:"text"`
					Annotations struct {
						Bold          bool   `json:"bold"`
						Italic        bool   `json:"italic"`
						Strikethrough bool   `json:"strikethrough"`
						Underline     bool   `json:"underline"`
						Code          bool   `json:"code"`
						Color         string `json:"color"`
					} `json:"annotations"`
					PlainText string `json:"plain_text"`
					Href      string `json:"href"`
				} `json:"title"`
			} `json:"Name"`
		} `json:"properties"`
		Url string `json:"url"`
	} `json:"results"`
	NextCursor string `json:"next_cursor"`
	HasMore    bool   `json:"has_more"`
	Type       string `json:"type"`
	Page       struct {
	} `json:"page"`
}

func FetchPages

func FetchPages(client *http.Client, filter FilterPages, id string, key string) (QueryResult, error)

type Status

type Status struct {
	Equals string `json:"equals"`
}

type Property string

type Text

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

type Title

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

Jump to

Keyboard shortcuts

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