brain

package
v0.0.0-...-0c6edc3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NEW    string = "new"
	LIST   string = "list"
	EDIT   string = "edit"
	MOVE   string = "move"
	DELETE string = "delete"
)

Variables

View Source
var (
	ErrInvalidBrainNode = errors.New("invalid brain node")
	ErrNotExist         = errors.New("node does not exist")
	ErrNodeIsDir        = errors.New("node is directory")
)
View Source
var BrainfileTemplate []byte

Functions

This section is empty.

Types

type Brain

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

func NewBrain

func NewBrain(ctx context.Context, config config.Config) (*Brain, error)

func (*Brain) Serve

func (b *Brain) Serve() error

func (*Brain) Shutdown

func (b *Brain) Shutdown(ctx context.Context) error

func (*Brain) Updater

func (b *Brain) Updater() chan<- struct{}

type Node

type Node struct {
	Title    string
	Tags     []string
	Raw      []byte
	Content  []byte
	Path     string
	IsDir    bool
	Children []*Node
}

func NewNodeFromBytes

func NewNodeFromBytes(data []byte) (Node, error)

func NewNodeFromFile

func NewNodeFromFile(filePath string) (Node, error)

type Tree

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

func (*Tree) Find

func (t *Tree) Find(path string) (*Node, error)

Jump to

Keyboard shortcuts

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