models

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package models holds the values the repositories return.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound reports that a path has no concept in the tenant's scope.

View Source
var ErrUnavailable = errors.New("database unavailable")

ErrUnavailable wraps every error that means the database is down.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Start  time.Time
	Writes int
	Reads  int
}

Bucket is one time bucket's concept-revision and read counts.

type Conflict

type Conflict struct {
	CurrentVersion int
	CurrentBody    string
}

Conflict is a stale expected version. CurrentBody is the text to merge against.

type GraphRow

type GraphRow struct {
	Path  string
	Type  string
	Title string
	Links []string
}

GraphRow is (path, type, title, links) for one concept, as Graph returns.

type GrepError

type GrepError struct{ Msg string }

GrepError reports a pattern Postgres could not compile or match within the timeout.

func (*GrepError) Error

func (e *GrepError) Error() string

type GrepHit

type GrepHit struct {
	Path    string
	Snippet string
}

GrepHit is one (path, snippet) match; the snippet is a card, not a body.

type Hit

type Hit struct {
	Path        string
	Type        string
	Title       string
	Description string
	Score       float64
	Frontmatter *okf.Map
	Snippet     string
	// Match is the byte offset in Snippet of the first matched term.
	Match int `db:"-"`
}

Hit is one search result. It carries no body, only the passages that match: the agent searches, chooses, then reads.

type NotFoundError

type NotFoundError struct{ Path string }

NotFoundError is ErrNotFound for one path.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Is

func (e *NotFoundError) Is(target error) bool

type PathType

type PathType struct {
	Path string
	Type string
}

PathType is one (path, type) pair, as List returns.

type Revision

type Revision struct {
	Path      string
	Version   int
	Op        string
	UpdatedBy string
	CreatedAt time.Time
	TenantID  uuid.UUID
	// Day is CreatedAt's date in the session TimeZone, as psycopg dates it.
	Day string
}

Revision is one entry in the revision log, without the snapshot that holds the body.

type Summary

type Summary struct {
	Path        string
	Type        string
	Title       string
	Description string
	Version     int
	UpdatedAt   time.Time
	TenantID    uuid.UUID
}

Summary is a concept table row: Hit without the score or frontmatter, plus TenantID for mixed-tenant pages.

type TenantCount

type TenantCount struct {
	TenantID uuid.UUID
	Count    int
}

TenantCount is one tenant and how many concepts it holds.

type Totals

type Totals struct {
	Concepts  int
	ByType    map[string]int
	Revisions int
	Links     int
	Orphans   int
}

Totals are corpus-wide counts for the admin console's summary tiles.

Jump to

Keyboard shortcuts

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