node

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

func CreateBlockNode

func CreateBlockNode(ctx context.Context, block notionapi.Block,
	rw rw.ReaderWriter) (*Node, error)

Create block node

func CreateDatabaseNode

func CreateDatabaseNode(ctx context.Context, database *notionapi.Database,
	rw rw.ReaderWriter) (*Node, error)

Create database node

func CreateNode

func CreateNode(obj *metadata.NotionObject) (*Node, error)

func CreatePageNode

func CreatePageNode(ctx context.Context, page *notionapi.Page,
	rw rw.ReaderWriter) (*Node, error)

Create page node

func CreateRootNode

func CreateRootNode() *Node

Special node which will act as a root node for a tree Root node will always have Nil UUID i.e. 00000000-0000-0000-0000-000000000000

func (*Node) AddChild

func (nodeObj *Node) AddChild(childNode *Node)

Adding a child to current node

func (*Node) DeleteChild

func (nodeObj *Node) DeleteChild(id NodeID) *Node

Delete a child with given node ID and return the deleted Node

func (*Node) GetChildNode

func (nodeObj *Node) GetChildNode() *Node

func (*Node) GetID

func (nodeObj *Node) GetID() NodeID

Various getter function for getting various properties of Node object

func (*Node) GetNodeType

func (nodeObj *Node) GetNodeType() NodeType

func (*Node) GetNotionObjectId

func (nodeObj *Node) GetNotionObjectId() string

func (*Node) GetParentNode

func (nodeObj *Node) GetParentNode() *Node

func (*Node) GetSiblingNode

func (nodeObj *Node) GetSiblingNode() *Node

func (*Node) GetStorageIdentifier

func (nodeObj *Node) GetStorageIdentifier() rw.DataIdentifier

func (*Node) HasChildNode

func (nodeObj *Node) HasChildNode() bool

func (*Node) HasSibling

func (nodeObj *Node) HasSibling() bool

type NodeID

type NodeID string

func (NodeID) String

func (id NodeID) String() string

type NodeType

type NodeType string
const (
	UNKNOWN  NodeType = "UNKNOWN"
	ROOT     NodeType = "ROOT"
	PAGE     NodeType = "PAGE"
	DATABASE NodeType = "DATABASE"
	BLOCK    NodeType = "BLOCK"
)

Jump to

Keyboard shortcuts

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