dbintegrations

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dbintegrations is the registry driven catalog of per database integration cards and the provider contract that reports their status.

Index

Constants

View Source
const AllEngines = "*"

AllEngines in a card's engine list means every engine.

Variables

View Source
var ErrReadOnly = errors.New("dbintegrations: provider is read only")

ErrReadOnly is returned by providers that only report status.

Functions

This section is empty.

Types

type Card

type Card struct {
	ID           string   `yaml:"id" json:"id"`
	Category     Category `yaml:"category" json:"category"`
	Title        string   `yaml:"title" json:"title"`
	Summary      string   `yaml:"summary" json:"summary"`
	Engines      []string `yaml:"engines" json:"engines"`
	Kind         Kind     `yaml:"kind" json:"kind"`
	Docs         string   `yaml:"docs" json:"docs"`
	DocsPlanned  bool     `yaml:"docs_planned" json:"docs_planned"`
	StatusSource string   `yaml:"status_source" json:"-"`
	Notes        string   `yaml:"notes" json:"-"`
	Featured     bool     `yaml:"featured" json:"featured"`
}

Card is one registry entry.

func Cards

func Cards() ([]Card, error)

Cards returns the embedded registry, parsed once.

func (Card) ExportKinds

func (c Card) ExportKinds() []string

ExportKinds returns the dataexport kinds a dataexport:<kinds> status source names.

func (Card) SupportsEngine

func (c Card) SupportsEngine(engine string) bool

SupportsEngine reports whether the card applies to engine.

type CardStatus

type CardStatus struct {
	Card
	State State `json:"state"`
}

CardStatus is one catalog card with its state for one database.

type Category

type Category string

Category groups cards in the dashboard index.

const (
	CategoryMonitor   Category = "monitor"
	CategoryDevelop   Category = "develop"
	CategoryDeploy    Category = "deploy"
	CategoryQuery     Category = "query"
	CategoryReplicate Category = "replicate"
)

The known card categories.

type Config

type Config struct {
	Settings map[string]string    `json:"settings,omitempty"`
	Secrets  map[string]SecretRef `json:"secrets,omitempty"`
}

Config is the input of Configure: plain settings plus secrets by reference.

type Database

type Database struct {
	Name   string
	Engine string
}

Database identifies the database a card is evaluated for.

type DestinationLister

type DestinationLister interface {
	List(ctx context.Context) ([]store.ExportDestination, error)
}

DestinationLister is the slice of internal/dataexport the read only export providers need; *dataexport.Service satisfies it.

type Kind

type Kind string

Kind says whether a card is backed by a connector or is a docs page.

const (
	KindConnector Kind = "connector"
	KindDocs      Kind = "docs"
)

The known card kinds.

type Provider

type Provider interface {
	ID() string
	Status(ctx context.Context, db Database) (State, error)
	Configure(ctx context.Context, db Database, cfg Config) error
}

Provider derives a card's status and, when it is a writable connector, applies its configuration.

func NewDatadogProvider

func NewDatadogProvider(src DestinationLister) Provider

NewDatadogProvider reports whether a Datadog export covers the database.

func NewOpenTelemetryProvider

func NewOpenTelemetryProvider(src DestinationLister) Provider

NewOpenTelemetryProvider reports whether an OTLP export covers the database.

type SecretRef

type SecretRef struct {
	Name string `json:"name"`
}

SecretRef points at a stored secret by name, so a config never holds a value.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service joins the registry with the registered providers.

func NewService

func NewService(logger *slog.Logger, providers ...Provider) *Service

NewService builds a service from providers keyed by their ID.

func (*Service) List

func (s *Service) List(ctx context.Context, db Database) ([]CardStatus, error)

List returns every card with its state for db. A provider failure degrades that card to unavailable instead of failing the catalog.

type State

type State struct {
	Code   StateCode `json:"code"`
	Reason string    `json:"reason,omitempty"`
}

State is a card's derived status with a short human reason.

type StateCode

type StateCode string

StateCode is the per card state shown in the dashboard and CLI.

const (
	StateConnected   StateCode = "connected"
	StateAvailable   StateCode = "available"
	StateNeedsSetup  StateCode = "needs_setup"
	StateDocsOnly    StateCode = "docs_only"
	StateUnavailable StateCode = "unavailable"
	StatePlanned     StateCode = "planned"
)

The card states.

Jump to

Keyboard shortcuts

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