Documentation
¶
Overview ¶
Package config는 위키별 설정 파일(engram.yaml)을 읽어 프론트매터 속성, 임계값, 디렉토리 매핑이 확정된 구성을 반환한다.
병합 순서는 기본값, 프리셋, 파일이다. 파일에 없는 키는 기본값이 남는다. 설정 파일이 없는 것은 에러가 아니며 기본값으로 동작한다.
Index ¶
Constants ¶
const ( DefaultBridgeWordMin = 0.30 DefaultBridgeEmbedMin = 0.72 )
bridge 하한 기본값이다. 단어 축 0.30 은 ADR 0028 이후 쓰던 값이다. 임베딩 축 0.72 는 upstream 실측값에서 출발했다(ADR 0075). 토크나이저가 달라 단어 축을 upstream 값 0.18 로 옮기지 않았다.
const ConfigFileName = "engram.yaml"
ConfigFileName은 위키 루트에 두는 설정 파일 이름이다. ADR 0017.
const DefaultPreset = PresetPersonal
DefaultPreset은 프리셋을 지정하지 않았을 때의 기본값이다.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Axis ¶
type Axis string
Axis는 프론트매터 스키마의 속성이다. 한국어 표기는 "속성"이고 코드 식별자와 engram.yaml 키는 axis, axes 로 남는다. ADR 0048.
const ( AxisType Axis = "type" AxisArtifactStage Axis = "artifact_stage" AxisStatus Axis = "status" AxisIndexable Axis = "indexable" AxisTags Axis = "tags" AxisSourceRefs Axis = "source_refs" AxisDerivedFrom Axis = "derived_from" AxisRelated Axis = "related" AxisSourceChannel Axis = "source_channel" AxisDerivedContext Axis = "derived_context" AxisScope Axis = "scope" AxisSensitivity Axis = "sensitivity" AxisTriggerMode Axis = "trigger_mode" AxisWorkflow Axis = "workflow" )
type Config ¶
type Config struct {
Preset Preset
Axes map[Axis]bool
Schema Schema
Thresholds Thresholds
PageDirs []string
RootFiles []string
// IgnoreFiles는 page_dirs 아래 어느 깊이에 있든 문서가 아닌 파일로
// 순회에서 빼는 파일명이다. ADR 0036.
IgnoreFiles []string
// DeprecatedFields는 이 위키가 폐기한 프론트매터 키다. 목록에 있는
// 키가 문서에 있으면 lint 가 error 로 잡는다. 폐기 목록은 위키마다
// 다르므로 기본값은 빈 목록이다. ADR 0071.
DeprecatedFields []string
// UnknownKeys는 설정 파일에 있었지만 스키마가 모르는 키다.
// 오타를 조용히 삼키지 않기 위해 호출자에게 넘긴다.
UnknownKeys []string
// Origins는 키별 값 출처다. 속성 키는 "axes.<속성 이름>" 형태다.
Origins map[string]Origin
}
Config는 한 위키의 확정된 구성이다.
type DateFields ¶
DateFields는 날짜 필드 셋이다. created는 정확도를 모르는 자료를 위해 연월 형식을 함께 허용한다. ADR 0009.
type Preset ¶
type Preset string
Preset은 프론트매터 속성의 시작점이 되는 프리셋이다. 포함 관계는 minimal이 personal에, personal이 team에 포함된다. ADR 0009, 0048.
type Schema ¶
type Schema struct {
Types []string
ArtifactStages ClosedSet
Statuses ClosedSet
Scopes ClosedSet
Sensitivities ClosedSet
TriggerModes ClosedSet
Dates DateFields
Taxonomy Taxonomy
}
Schema는 lint가 문서 필드 값을 대조할 허용값 집합이다. source_channel과 workflow는 개방 집합이라 여기 담지 않는다.