store

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEntry

type AddEntry struct {
	Depth     int
	Title     string
	Body      string
	Tags      []string
	Source    string
	Origin    string
	CreatedAt *time.Time
	UpdatedAt *time.Time
}

type DepthSummary

type DepthSummary struct {
	Depth int
	Count int
}

type DuplicateMatch

type DuplicateMatch struct {
	Entry      Entry   `json:"entry"`
	Similarity float64 `json:"similarity"`
}

type Entry

type Entry struct {
	ID        int       `json:"id"`
	Depth     int       `json:"depth"`
	Title     string    `json:"title"`
	Body      string    `json:"body"`
	Tags      []string  `json:"tags,omitempty"`
	Source    string    `json:"source,omitempty"`
	SourceRef string    `json:"source_ref,omitempty"`
	Origin    string    `json:"origin,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Query

type Query struct {
	Depth *int
	Text  string
	Tag   string
	Limit int
}

type Repository

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

func NewRepository

func NewRepository(path, indexPath string, provider vector.Provider) *Repository

func (*Repository) Add

func (r *Repository) Add(req AddEntry) (Entry, error)

func (*Repository) AddMany

func (r *Repository) AddMany(requests []AddEntry) ([]Entry, error)

func (*Repository) Delete

func (r *Repository) Delete(id int) (bool, error)

func (*Repository) DepthCounts

func (r *Repository) DepthCounts() ([]DepthSummary, error)

func (*Repository) DuplicateCheck

func (r *Repository) DuplicateCheck(content string, threshold float64) ([]DuplicateMatch, error)

func (*Repository) Get

func (r *Repository) Get(id int) (Entry, bool, error)

func (*Repository) Init

func (r *Repository) Init() error

func (*Repository) List

func (r *Repository) List(q Query) ([]Entry, error)

func (*Repository) ListMetadata added in v1.3.8

func (r *Repository) ListMetadata(q Query) ([]Entry, error)

func (*Repository) RebuildIndex

func (r *Repository) RebuildIndex() error

func (*Repository) Search

func (r *Repository) Search(q Query) ([]Entry, error)

func (*Repository) SearchDetailed

func (r *Repository) SearchDetailed(q Query) ([]SearchResult, error)

func (*Repository) SetPhaseHook added in v1.3.8

func (r *Repository) SetPhaseHook(hook func(string, time.Duration))

func (*Repository) Update

func (r *Repository) Update(id int, req AddEntry) (Entry, bool, error)

type SearchResult

type SearchResult struct {
	Entry         Entry `json:"entry"`
	SupportCount  int   `json:"support_count,omitempty"`
	SourceKinds   int   `json:"source_kinds,omitempty"`
	ConflictCount int   `json:"conflict_count,omitempty"`
}

type Snapshot

type Snapshot struct {
	Version int     `json:"version"`
	NextID  int     `json:"next_id"`
	Entries []Entry `json:"entries"`
}

Jump to

Keyboard shortcuts

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