Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnchorKinds = []AnchorKind{ AnchorKindWarning, AnchorKindTodo, AnchorKindHandoff, AnchorKindRationale, AnchorKindInvariant, AnchorKindQuestion, }
AnchorKinds lists every valid kind, in the order error messages report them.
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
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 AnchorKind ¶
type AnchorKind string
const ( AnchorKindWarning AnchorKind = "warning" AnchorKindTodo AnchorKind = "todo" AnchorKindHandoff AnchorKind = "handoff" AnchorKindRationale AnchorKind = "rationale" AnchorKindInvariant AnchorKind = "invariant" AnchorKindQuestion AnchorKind = "question" )
func ParseAnchorKind ¶ added in v1.0.4
func ParseAnchorKind(value string) (AnchorKind, error)
ParseAnchorKind resolves a caller-supplied kind. An empty value takes the default; anything else must name a real kind.
This used to fall back to the default for unrecognized input, which quietly replaced what the caller asked for -- a misspelled kind was stored as "warning" and the mistake was invisible afterwards.
type AnchorStatus ¶
type AnchorStatus string
const ( AnchorStatusActive AnchorStatus = "active" AnchorStatusResolved AnchorStatus = "resolved" AnchorStatusStale AnchorStatus = "stale" AnchorStatusArchived AnchorStatus = "archived" )
func ParseAnchorStatus ¶ added in v1.0.4
func ParseAnchorStatus(value string) (AnchorStatus, error)
ParseAnchorStatus resolves a caller-supplied status filter. An empty value means "no filter"; anything unrecognized is refused rather than silently matching nothing.
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 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 ¶
Click to show internal directories.
Click to hide internal directories.