Documentation
¶
Index ¶
- Constants
- func LoadSourceRoot(sourceRoot string) (string, []byte, error)
- func VerifyDistFiles(distRoot string, result BuildResult) error
- func WriteDistFiles(distRoot string, result BuildResult) error
- type BuildResult
- type Bundle
- type BundleManifest
- type Concept
- type ConceptLink
- type ConceptSummary
- type IndexEntry
- type IndexRequest
- type IndexResult
- type IndexSection
- type OpenRequest
- type OpenResult
- type RootIndex
- type SearchFilters
- type SearchMatch
- type SearchRequest
- type SearchResult
Constants ¶
View Source
const ( SchemaVersion = 2 OKFVersion = "0.1" )
Variables ¶
This section is empty.
Functions ¶
func VerifyDistFiles ¶
func VerifyDistFiles(distRoot string, result BuildResult) error
func WriteDistFiles ¶
func WriteDistFiles(distRoot string, result BuildResult) error
Types ¶
type BuildResult ¶
type BuildResult struct {
Bundle Bundle
BundleJSON []byte
Manifest BundleManifest
ManifestJSON []byte
SHA256File []byte
}
func BuildFromSource ¶
func BuildFromSource(sourceRoot string) (BuildResult, error)
type Bundle ¶
type Bundle struct {
SchemaVersion int `json:"schema_version"`
OKFVersion string `json:"okf_version"`
RootIndex RootIndex `json:"root_index"`
Concepts []Concept `json:"concepts"`
SourceSHA256 string `json:"source_sha256"`
}
func LoadEmbeddedBundle ¶
type BundleManifest ¶
type Concept ¶
type Concept struct {
Path string `json:"path"`
ConceptID string `json:"concept_id"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Resource string `json:"resource,omitempty"`
Tags []string `json:"tags,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Frontmatter map[string]any `json:"frontmatter,omitempty"`
Body string `json:"body"`
Snippet string `json:"snippet,omitempty"`
Links []ConceptLink `json:"links,omitempty"`
Backlinks []ConceptLink `json:"backlinks,omitempty"`
}
type ConceptLink ¶ added in v0.7.2
type ConceptSummary ¶ added in v0.7.2
type IndexEntry ¶ added in v0.7.2
type IndexEntry struct {
ConceptSummary
}
type IndexRequest ¶ added in v0.7.2
type IndexRequest struct {
Section string
}
type IndexResult ¶ added in v0.7.2
type IndexResult struct {
OKFVersion string `json:"okf_version"`
TotalSections int `json:"total_sections"`
Sections []IndexSection `json:"sections"`
Truncated bool `json:"truncated"`
}
func Index ¶ added in v0.7.2
func Index(req IndexRequest) (IndexResult, error)
func IndexBundle ¶ added in v0.7.2
func IndexBundle(bundle Bundle, req IndexRequest) IndexResult
type IndexSection ¶ added in v0.7.2
type IndexSection struct {
Title string `json:"title"`
Slug string `json:"slug"`
Entries []IndexEntry `json:"entries"`
}
type OpenRequest ¶ added in v0.7.2
type OpenResult ¶ added in v0.7.2
type OpenResult struct {
Concept ConceptSummary `json:"concept"`
Body string `json:"body"`
BodyOffset int `json:"body_offset"`
BodyLength int `json:"body_length"`
ReturnedBodyLength int `json:"returned_body_length"`
Truncated bool `json:"truncated"`
Links []ConceptLink `json:"links"`
Backlinks []ConceptLink `json:"backlinks"`
}
func Open ¶ added in v0.7.2
func Open(req OpenRequest) (OpenResult, error)
func OpenBundle ¶ added in v0.7.2
func OpenBundle(bundle Bundle, req OpenRequest) (OpenResult, error)
type RootIndex ¶
type RootIndex struct {
Path string `json:"path"`
OKFVersion string `json:"okf_version"`
Frontmatter map[string]any `json:"frontmatter,omitempty"`
Body string `json:"body"`
Sections []IndexSection `json:"sections,omitempty"`
Links []ConceptLink `json:"links,omitempty"`
}
type SearchFilters ¶ added in v0.7.2
type SearchMatch ¶
type SearchMatch struct {
ConceptID string `json:"concept_id"`
Path string `json:"path"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Resource string `json:"resource,omitempty"`
Tags []string `json:"tags,omitempty"`
Snippet string `json:"snippet,omitempty"`
Score int `json:"score"`
}
type SearchRequest ¶
type SearchResult ¶
type SearchResult struct {
Query string `json:"query"`
Filters SearchFilters `json:"filters,omitempty"`
TotalConcepts int `json:"total_concepts"`
TotalMatches int `json:"total_matches"`
MatchCount int `json:"match_count"`
MaxResults int `json:"max_results"`
HasMore bool `json:"has_more"`
OmittedCount int `json:"omitted_count"`
Matches []SearchMatch `json:"matches"`
Truncated bool `json:"truncated"`
}
func Search ¶
func Search(req SearchRequest) (SearchResult, error)
func SearchBundle ¶ added in v0.7.2
func SearchBundle(bundle Bundle, req SearchRequest) SearchResult
Click to show internal directories.
Click to hide internal directories.