db

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSynonyms

func GetSynonyms(db *sql.DB) (map[string]string, error)

GetSynonyms returns all synonym rows.

func Open

func Open(embeddedDB []byte) (*sql.DB, error)

Open writes embedded DB bytes to a temp file and opens it read-only.

func OpenRW

func OpenRW(path string) (*sql.DB, error)

OpenRW opens (or creates) a read-write SQLite DB at path. Used by ingest tool.

func ResolveProduct

func ResolveProduct(db *sql.DB, slug string) (string, error)

ResolveProduct maps alias → canonical product id.

Types

type Endpoint

type Endpoint struct {
	ID           int64
	ProductID    string
	Release      string
	Method       string
	Path         string
	Summary      string
	Description  string
	Tags         string // raw JSON array
	Parameters   string // raw JSON array
	RequestBody  string // raw JSON object
	Responses    string // raw JSON object
	SourceFormat string
}

Endpoint represents one HTTP operation.

func GetEndpoint

func GetEndpoint(db *sql.DB, productID, releasePrefix, method, path string) (*Endpoint, error)

GetEndpoint fetches full endpoint detail. releasePrefix filters by release using prefix matching; empty matches any release. If multiple releases match with no prefix, returns an error listing available releases.

type Product

type Product struct {
	ID          string
	Name        string
	Description string
	BaseURL     string
	AuthType    string
	AuthNotes   string
	AuthSchema  string // raw JSON
}

Product represents one Cisco API product.

func GetProduct

func GetProduct(db *sql.DB, id string) (*Product, error)

GetProduct returns full product row.

type SearchResult

type SearchResult struct {
	ProductID string
	Release   string
	Method    string
	Path      string
	Summary   string
}

SearchResult is a lightweight endpoint for search output.

func SearchEndpoints

func SearchEndpoints(db *sql.DB, ftsQuery, productID, releasePrefix string, limit int) ([]SearchResult, int, error)

SearchEndpoints runs FTS5 query and returns ranked results. releasePrefix filters by release using prefix matching (e.g. "3" matches "3.2.2m"). Empty productID or releasePrefix disables that filter.

Jump to

Keyboard shortcuts

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