node

package
v0.0.0-...-f1b04be Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package node provides a low level API to handle nodes in a content tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID       string
	Parent   string
	Children []string
	Path     []Node
}

Node represents one single node in the content tree.

func New

func New(parent string) Node

New returns a new Node.

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (n Node, err error)      // Get a node from content tree
	Put(ctx context.Context, n Node) (id string, err error)      // Put a node in the content tree
	Move(ctx context.Context, n Node, parent string) (err error) // Move a node to another parent node in the content tree
}

Repository provides a limited interface to a storage layer.

Jump to

Keyboard shortcuts

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