Documentation
¶
Overview ¶
Package resurface는 오래 안 본 context 문서를 다시 꺼낸다. 재발견 커맨드 중 유일하게 상태를 읽고 쓴다. 제시 이력은 .engram/resurface.json 에 두며 사라져도 중복 제시가 생길 뿐이므로 이력이 깨졌다고 도구가 멈추지 않는다. ADR 0028.
Index ¶
Constants ¶
View Source
const CooldownDays = 21
CooldownDays는 한 번 제시한 문서를 후보에서 빼 두는 기간이다. 설정으로 노출하지 않는다(ADR 0010 과 같은 이유). upstream 과 같은 값이다.
Variables ¶
This section is empty.
Functions ¶
func BaseDate ¶
BaseDate는 문서의 기준 날짜를 반환한다. updated 를 우선하고 없으면 created 를 쓴다. 둘 다 없으면 false 다. digest 의 노후 집계도 이 규칙을 쓰므로 노후 판정의 단일 진실원을 여기에 둔다.
func LoadHistory ¶
LoadHistory는 제시 이력을 읽는다. 파일이 없거나 파싱에 실패하거나 스키마 버전이 다르면 빈 이력으로 취급한다. 재생성 가능한 캐시가 깨졌다고 도구가 멈추면 안 된다.
Types ¶
type Candidate ¶
type Candidate struct {
Slug string `json:"slug"`
Title string `json:"title"`
Path string `json:"path"`
AgeDays int `json:"daysSinceUpdate"`
Inbound int `json:"inboundLinks"`
Score float64 `json:"score"`
LastShown *time.Time `json:"lastShown"`
Cooldown bool `json:"cooldown"`
}
Candidate는 다시 꺼낼 문서 하나다. 근거가 되는 경과일과 제시 이력을 함께 실는다. 문장은 만들지 않는다(design.md 재발견 절).
type Result ¶
type Result struct {
StaleDays int `json:"staleDays"`
Now time.Time `json:"now"`
SkippedNoDate int `json:"skippedNoDate"`
Candidates []Candidate `json:"candidates"`
CooldownDays int `json:"cooldownDays"`
CooldownFilled int `json:"cooldownFilled"`
NoInbound []Unlinked `json:"noInbound"`
Reason string `json:"reason,omitempty"`
}
Result는 resurface 실행 결과다. 후보가 없으면 Reason 에 이유가 들어간다.
Click to show internal directories.
Click to hide internal directories.