entities

package
v0.8.18 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatText

func FormatText(entities []Entity) string

func NoteRelativePath

func NoteRelativePath(kind Kind, key string) string

Types

type Entity

type Entity struct {
	Key            string      `json:"key"`
	Name           string      `json:"name"`
	Kind           Kind        `json:"kind"`
	Aliases        []string    `json:"aliases,omitempty"`
	CanonicalURL   string      `json:"canonical_url,omitempty"`
	Domain         string      `json:"domain,omitempty"`
	NotePath       string      `json:"note_path"`
	SourceTypes    []string    `json:"source_types,omitempty"`
	ReferenceCount int         `json:"reference_count"`
	References     []Reference `json:"references,omitempty"`
	Links          []Link      `json:"links,omitempty"`
}

func BuildIndex

func BuildIndex(ctx context.Context, st *store.Store) ([]Entity, error)

func Filter

func Filter(entities []Entity, query string, opts SearchOptions) []Entity
func Search(ctx context.Context, st *store.Store, query string, opts SearchOptions) ([]Entity, error)

type Kind

type Kind string
const (
	KindPerson  Kind = "person"
	KindOrg     Kind = "org"
	KindProject Kind = "project"
	KindSite    Kind = "site"
)
type Link struct {
	Key          string `json:"key"`
	Name         string `json:"name"`
	Kind         Kind   `json:"kind"`
	NotePath     string `json:"note_path"`
	Relationship string `json:"relationship"`
}

type Reference

type Reference struct {
	RefKind      string `json:"ref_kind"`
	SourceKey    string `json:"source_key"`
	Title        string `json:"title"`
	NotePath     string `json:"note_path"`
	URL          string `json:"url"`
	SourceType   string `json:"source_type"`
	Relationship string `json:"relationship"`
}

type SearchOptions

type SearchOptions struct {
	Kind  string
	Limit int
}

Jump to

Keyboard shortcuts

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