domain

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewID

func NewID(prefix string) string

Types

type Anchor

type Anchor struct {
	ID        string       `json:"id"`
	RepoID    string       `json:"repo_id"`
	Kind      AnchorKind   `json:"kind"`
	Status    AnchorStatus `json:"status"`
	Title     string       `json:"title"`
	Body      string       `json:"body"`
	Author    string       `json:"author"`
	SourceRef string       `json:"source_ref"`
	Tags      []string     `json:"tags"`
	Binding   Binding      `json:"binding"`
	CreatedAt time.Time    `json:"created_at"`
	UpdatedAt time.Time    `json:"updated_at"`
}

type AnchorEvent

type AnchorEvent struct {
	ID          string          `json:"id"`
	AnchorID    string          `json:"anchor_id"`
	Type        AnchorEventType `json:"type"`
	Reason      string          `json:"reason"`
	Confidence  float64         `json:"confidence"`
	FromBinding *Binding        `json:"from_binding,omitempty"`
	ToBinding   *Binding        `json:"to_binding,omitempty"`
	CreatedAt   time.Time       `json:"created_at"`
}

type AnchorEventType

type AnchorEventType string
const (
	AnchorEventCreated AnchorEventType = "created"
	AnchorEventUpdated AnchorEventType = "updated"
	AnchorEventMoved   AnchorEventType = "moved"
	AnchorEventStale   AnchorEventType = "stale"
)

type AnchorFilter

type AnchorFilter struct {
	RepoID     string
	Path       string
	SymbolPath string
	Status     AnchorStatus
	Limit      int
	Offset     int
}

type AnchorKind

type AnchorKind string
const (
	AnchorKindWarning   AnchorKind = "warning"
	AnchorKindTodo      AnchorKind = "todo"
	AnchorKindHandoff   AnchorKind = "handoff"
	AnchorKindRationale AnchorKind = "rationale"
	AnchorKindInvariant AnchorKind = "invariant"
	AnchorKindQuestion  AnchorKind = "question"
)

type AnchorStatus

type AnchorStatus string
const (
	AnchorStatusActive   AnchorStatus = "active"
	AnchorStatusResolved AnchorStatus = "resolved"
	AnchorStatusStale    AnchorStatus = "stale"
	AnchorStatusArchived AnchorStatus = "archived"
)

type Binding

type Binding struct {
	Type             BindingType `json:"type"`
	Ref              string      `json:"ref"`
	Path             string      `json:"path"`
	Language         string      `json:"language"`
	SymbolPath       string      `json:"symbol_path,omitempty"`
	StartLine        int         `json:"start_line"`
	StartCol         int         `json:"start_col"`
	EndLine          int         `json:"end_line"`
	EndCol           int         `json:"end_col"`
	SelectedText     string      `json:"selected_text"`
	SelectedTextHash string      `json:"selected_text_hash"`
	BeforeContext    string      `json:"before_context,omitempty"`
	BeforeHash       string      `json:"before_hash,omitempty"`
	AfterContext     string      `json:"after_context,omitempty"`
	AfterHash        string      `json:"after_hash,omitempty"`
	// BaseCommit is the commit these line numbers were valid against. It gives
	// resolution a point to diff from, so a span can be relocated by git
	// history instead of by guessing from text. Empty on anchors written
	// before this existed, which simply fall back to text matching.
	BaseCommit string  `json:"base_commit,omitempty"`
	Confidence float64 `json:"confidence"`
}

type BindingType

type BindingType string
const (
	BindingTypeFile   BindingType = "file"
	BindingTypeSpan   BindingType = "span"
	BindingTypeSymbol BindingType = "symbol"
)

type Comment

type Comment struct {
	ID        string    `json:"id"`
	AnchorID  string    `json:"anchor_id"`
	ParentID  string    `json:"parent_id,omitempty"`
	Author    string    `json:"author"`
	Body      string    `json:"body"`
	CreatedAt time.Time `json:"created_at"`
}

type Repo

type Repo struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	RootPath   string    `json:"root_path"`
	DefaultRef string    `json:"default_ref"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type SearchHit

type SearchHit struct {
	DocumentType string     `json:"document_type"`
	DocumentID   string     `json:"document_id"`
	AnchorID     string     `json:"anchor_id"`
	CommentID    string     `json:"comment_id,omitempty"`
	RepoID       string     `json:"repo_id"`
	Path         string     `json:"path"`
	SymbolPath   string     `json:"symbol_path,omitempty"`
	Kind         AnchorKind `json:"kind,omitempty"`
	Title        string     `json:"title,omitempty"`
	Body         string     `json:"body"`
	Snippet      string     `json:"snippet"`
	Score        float64    `json:"score"`
}

type SearchQuery

type SearchQuery struct {
	Query      string
	RepoID     string
	Path       string
	SymbolPath string
	Kind       AnchorKind
	Limit      int
	Offset     int
}

type Symbol

type Symbol struct {
	Path       string `json:"path"`
	Language   string `json:"language"`
	Kind       string `json:"kind"`
	SymbolPath string `json:"symbol_path"`
	StartLine  int    `json:"start_line"`
	StartCol   int    `json:"start_col"`
	EndLine    int    `json:"end_line"`
	EndCol     int    `json:"end_col"`
}

Jump to

Keyboard shortcuts

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