docs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Overview

Package docs holds reduced public docs-provider contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	DB() (*sql.DB, error)
}

Connector is the reduced public docs connector contract.

This is a bounded compatibility seam for provider-backed docs lookup, not a signal that docs ownership belongs to SQL/database runtime behavior.

type Option

type Option func(o *Options)

Option mutates docs-provider options.

func WithConnector

func WithConnector(connector Connector) Option

func WithURL

func WithURL(URL string) Option

type Options

type Options struct {
	URL       string
	Connector Connector
}

Options is the reduced public docs-provider option bag.

type Provider

type Provider interface {
	Service(ctx context.Context, options ...Option) (Service, error)
}

Provider creates a documentation lookup service.

type Service

type Service interface {
	Lookup(ctx context.Context, key string) (string, bool, error)
}

Service looks up documentation payloads by key.

type Source added in v1.0.0

type Source struct {
	GlobalURLs  []string          `json:"globalURLs,omitempty" yaml:"GlobalURLs,omitempty"`
	Substitutes map[string]string `json:"substitutes,omitempty" yaml:"Substitutes,omitempty"`
	BaseURL     string            `json:"baseURL,omitempty" yaml:"BaseURL,omitempty"`
	DocURL      string            `json:"docURL,omitempty" yaml:"DocURL,omitempty"`
	DocURLs     []string          `json:"docURLs,omitempty" yaml:"DocURLs,omitempty"`
}

Source declares an ordered documentation overlay in the canonical resource store. DocURLs takes precedence over DocURL. BaseURL is a resource directory, optionally qualified by its registered filesystem namespace.

func (Source) Clone added in v1.0.0

func (s Source) Clone() Source

func (Source) Expand added in v1.0.0

func (s Source) Expand(text string) string

Expand follows original Datly's longest-name-first substitution order, with lexical ties to make equal-length overlapping substitutions deterministic.

func (Source) IsZero added in v1.0.0

func (s Source) IsZero() bool

func (Source) Overlay added in v1.0.0

func (s Source) Overlay(authored Source) Source

Overlay preserves package source declarations unless authored DQL supplies that group. Dictionary content merging remains the documentation loader's job.

Jump to

Keyboard shortcuts

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