Help us shape the future of Go! Take the 2026 Go Developer Survey

docs

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package docs serves the documentation bundled in the binary so it is available offline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	Name  string `json:"name"`
	Title string `json:"title"`
}

Doc describes a bundled document.

type Match

type Match struct {
	Name string `json:"name"`
	Line int    `json:"line"`
	Text string `json:"text"`
}

Match is one search hit.

type Store

type Store struct{ FS fs.FS }

Store reads docs from a filesystem of top-level *.md files.

func Bundled

func Bundled() Store

Bundled returns the store embedded in this binary.

func (Store) List

func (s Store) List() ([]Doc, error)

List returns all documents sorted by name.

func (Store) Search

func (s Store) Search(query string, limit int) ([]Match, error)

Search returns case-insensitive line matches across all documents. Every whitespace-separated term must appear in the line.

func (Store) Show

func (s Store) Show(name string) ([]byte, error)

Show returns a document by name, with or without the .md suffix.

Jump to

Keyboard shortcuts

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