readitem

package
v0.0.0-...-4d14c86 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoValue  = errors.New("no id given")
	ErrNotFound = errors.New("item not found")
)

Functions

func Process

func Process(ctx context.Context, db bun.IDB, kind domain.Kind, id string) *run

Process loads one item of the given kind that is not in the trash.

Types

type Result

type Result struct {
	Item     domain.Item   `json:"item"`
	Path     string        `json:"path"`
	Content  string        `json:"content,omitempty" binding:"optional"`
	Pinned   bool          `json:"pinned,omitempty" binding:"optional"`
	Readonly bool          `json:"readonly,omitempty" binding:"optional"` // locked: PATCH refuses its content and tags
	ForkOf   string        `json:"fork_of,omitempty" binding:"optional"`  // a fork: the note it merges back into
	Tags     []string      `json:"tags,omitzero" binding:"optional"`
	Children []domain.Item `json:"children,omitzero" binding:"optional"`
}

Result is the item and its path, with its content and tag values for a note, its direct children for a folder.

Jump to

Keyboard shortcuts

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