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

jsonschema

package
v0.3.0-rc2 Latest Latest
Warning

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

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

Documentation

Overview

Package jsonschema defines the versioned JSON output schema for the dbc CLI. It is the single source of truth for every --json payload emitted by the CLI and consumed by the Rust GUI. Field names MUST NOT be renamed without updating both consumers.

Index

Constants

View Source
const SchemaVersion = 1

SchemaVersion is the current JSON schema version. Increment when making backward-incompatible changes to any payload type.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddResponse

type AddResponse struct {
	// DriverListPath is the filesystem path of the driver list that was modified.
	DriverListPath string `json:"driver_list_path"`
	// Drivers lists every driver entry that was added or updated.
	Drivers []AddResponseDriver `json:"drivers"`
}

AddResponse is the JSON payload emitted after adding drivers to a driver list.

type AddResponseDriver

type AddResponseDriver struct {
	// Name is the driver identifier.
	Name string `json:"name"`
	// VersionConstraint is the optional semver constraint that was recorded.
	VersionConstraint string `json:"version_constraint,omitempty"`
}

AddResponseDriver carries the driver entry that was appended to the driver list.

type AuthDeviceCodeEvent

type AuthDeviceCodeEvent struct {
	// VerificationURI is the URL the user should visit to authorise the device.
	VerificationURI string `json:"verification_uri"`
	// VerificationURIComplete is the URL with the user code pre-filled.
	VerificationURIComplete string `json:"verification_uri_complete"`
	// UserCode is the short code the user must enter at the verification URI.
	UserCode string `json:"user_code"`
	// ExpiresIn is the number of seconds until the code expires.
	ExpiresIn int `json:"expires_in"`
	// Interval is the minimum polling interval in seconds.
	Interval int `json:"interval"`
}

AuthDeviceCodeEvent is the JSON payload emitted during OAuth device-code flow. The CLI emits this once so the user can open a browser to complete auth.

type AuthLicenseInstallResponse

type AuthLicenseInstallResponse struct {
	// Status is the outcome: "success" or "error".
	Status string `json:"status"`
	// LicensePath is the filesystem path where the license was written.
	LicensePath string `json:"license_path"`
}

AuthLicenseInstallResponse is the JSON payload emitted after installing a license file.

type AuthLoginResponse

type AuthLoginResponse struct {
	// Status is the outcome: "success" or "failed".
	Status string `json:"status"`
	// Registry is the registry URL that was authenticated against.
	Registry string `json:"registry"`
	// Message is an optional detail string (e.g. failure reason).
	Message string `json:"message,omitempty"`
}

AuthLoginResponse is the JSON payload emitted after an auth login attempt.

type AuthLogoutResponse

type AuthLogoutResponse struct {
	// Status is the outcome: "success" or "error".
	Status string `json:"status"`
	// Registry is the registry URL from which credentials were removed.
	Registry string `json:"registry"`
}

AuthLogoutResponse is the JSON payload emitted after an auth logout.

type AuthRegistryStatus

type AuthRegistryStatus struct {
	// URL is the registry URL.
	URL string `json:"url"`
	// Authenticated indicates whether valid credentials exist for this registry.
	Authenticated bool `json:"authenticated"`
	// AuthType is the credential type in use: "oauth" or "api_key". Empty when not authenticated.
	AuthType string `json:"auth_type,omitempty"`
	// LicenseValid indicates whether a valid Columnar license is present.
	LicenseValid bool `json:"license_valid"`
}

AuthRegistryStatus describes the authentication state for a single registry.

type AuthStatus

type AuthStatus struct {
	// Registries lists the status for each known registry.
	Registries []AuthRegistryStatus `json:"registries"`
}

AuthStatus is the JSON payload for the auth status command. It summarises the authentication state across all known registries.

type DriverInfo

type DriverInfo struct {
	// Driver is the driver identifier path.
	Driver string `json:"driver"`
	// Version is the latest version string.
	Version string `json:"version"`
	// Title is the human-readable display name of the driver.
	Title string `json:"title"`
	// License is the SPDX license identifier.
	License string `json:"license"`
	// Description is a detailed description of the driver.
	Description string `json:"description"`
	// Packages lists the supported platform tuples.
	Packages []string `json:"packages"`
}

DriverInfo is the JSON payload for the info command. It corresponds to the inline struct in cmd/dbc/info.go.

type Envelope

type Envelope struct {
	// SchemaVersion identifies the schema revision for forward-compatibility checks.
	SchemaVersion int `json:"schema_version"`
	// Kind names the payload type (e.g. "install.status", "search.response").
	Kind string `json:"kind"`
	// Payload is the raw JSON-encoded type-specific data.
	Payload json.RawMessage `json:"payload"`
}

Envelope is the top-level wrapper for every structured JSON response emitted by the CLI. The payload field contains a type-specific JSON object identified by the kind field.

type ErrorResponse

type ErrorResponse struct {
	// Code is a machine-readable error identifier (e.g. "not_found", "permission_denied").
	Code string `json:"code"`
	// Message is a human-readable error description.
	Message string `json:"message"`
	// OwnerPID is the PID of the process holding a lock, when applicable.
	OwnerPID int `json:"owner_pid,omitempty"`
}

ErrorResponse is the JSON payload emitted when a command fails with an error. It is used in place of all other payloads when Kind == "error".

type InitResponse

type InitResponse struct {
	// DriverListPath is the filesystem path of the created or existing driver list.
	DriverListPath string `json:"driver_list_path"`
	// Created is true when the file was newly created, false if it already existed.
	Created bool `json:"created"`
}

InitResponse is the JSON payload emitted when a driver list file is initialised.

type InstallProgressEvent

type InstallProgressEvent struct {
	// Event identifies the progress step. Valid values:
	// "download.start", "download.progress", "download.complete",
	// "extract.start", "extract.complete",
	// "verify.start", "verify.complete", "verify.checksum.ok", "verify.checksum.mismatch",
	// "manifest.create", "install.complete".
	Event string `json:"event"`
	// Driver is the driver identifier being installed.
	Driver string `json:"driver"`
	// Bytes is the number of bytes transferred so far (download events only).
	Bytes int64 `json:"bytes,omitempty"`
	// Total is the expected total byte count (download events only).
	Total int64 `json:"total,omitempty"`
	// Checksum is the computed or expected checksum value (verify events only).
	Checksum string `json:"checksum,omitempty"`
}

InstallProgressEvent is a single line in the NDJSON progress stream emitted during a driver installation. Clients should consume a stream of these events until install.complete is received.

type InstallStatus

type InstallStatus struct {
	// Status is the outcome: "installed", "already installed", or "error".
	Status string `json:"status"`
	// Driver is the driver identifier (e.g. "snowflake").
	Driver string `json:"driver"`
	// Version is the installed driver version string.
	Version string `json:"version"`
	// Location is the filesystem path where the driver was installed.
	Location string `json:"location"`
	// Message is an optional post-install notice provided by the driver manifest.
	Message string `json:"message,omitempty"`
	// Conflict describes any pre-existing driver that was replaced, if applicable.
	Conflict string `json:"conflict,omitempty"`
	// Checksum is the hex-encoded checksum of the installed artifact (added for T7).
	Checksum string `json:"checksum,omitempty"`
}

InstallStatus is the final JSON payload emitted after a driver installation attempt. It corresponds to the inline struct in cmd/dbc/install.go.

type ListDriverEntry

type ListDriverEntry struct {
	// Driver is the driver identifier path.
	Driver string `json:"driver"`
	// Name is the human-readable driver name from its manifest.
	Name string `json:"name"`
	// Version is the installed driver version string.
	Version string `json:"version"`
	// Level is the config level where the driver is installed: "system", "user", or "env".
	Level string `json:"level"`
	// Location is the filesystem path containing the driver's manifest.
	Location string `json:"location"`
}

ListDriverEntry is a single installed driver entry in a list response.

type ListResponse

type ListResponse struct {
	// Drivers is the list of installed drivers across all inspected config levels.
	Drivers []ListDriverEntry `json:"drivers"`
}

ListResponse is the top-level JSON payload for the list command.

type RemoveResponse

type RemoveResponse struct {
	// DriverListPath is the filesystem path of the driver list that was modified.
	DriverListPath string `json:"driver_list_path"`
	// Driver is the entry that was removed.
	Driver RemoveResponseDriver `json:"driver"`
}

RemoveResponse is the JSON payload emitted after removing a driver from a list.

type RemoveResponseDriver

type RemoveResponseDriver struct {
	// Name is the driver identifier.
	Name string `json:"name"`
}

RemoveResponseDriver carries the driver entry that was removed from the list.

type SearchDriverBasic

type SearchDriverBasic struct {
	// Driver is the driver identifier path.
	Driver string `json:"driver"`
	// Description is a human-readable summary of the driver.
	Description string `json:"description"`
	// Installed lists the installed versions of this driver, if any.
	Installed []string `json:"installed,omitempty"`
	// Registry is the source registry name, if not the default.
	Registry string `json:"registry,omitempty"`
}

SearchDriverBasic is a single driver entry in a non-verbose search response. It corresponds to the basic output struct in cmd/dbc/search.go.

type SearchDriverVerbose

type SearchDriverVerbose struct {
	// Driver is the driver identifier path.
	Driver string `json:"driver"`
	// Description is a human-readable summary of the driver.
	Description string `json:"description"`
	// License is the SPDX license identifier for the driver.
	License string `json:"license"`
	// Registry is the source registry name, if not the default.
	Registry string `json:"registry,omitempty"`
	// InstalledVersions maps platform tuple to a list of installed versions.
	InstalledVersions map[string][]string `json:"installed_versions,omitempty"`
	// AvailableVersions lists all versions available for the current platform.
	AvailableVersions []string `json:"available_versions,omitempty"`
}

SearchDriverVerbose is a single driver entry in a verbose search response. It corresponds to the verbose output struct in cmd/dbc/search.go.

type SearchResponse

type SearchResponse struct {
	// Drivers is the raw JSON array of driver entries (basic or verbose).
	Drivers json.RawMessage `json:"drivers"`
	// Warning is an optional message when some registries were unavailable.
	Warning string `json:"warning,omitempty"`
}

SearchResponse is the top-level JSON payload for the search command. The drivers field is raw JSON to accommodate both SearchDriverBasic and SearchDriverVerbose slices without a common interface.

type SyncError

type SyncError struct {
	// Name is the driver identifier.
	Name string `json:"name"`
	// Error is a human-readable description of the failure.
	Error string `json:"error"`
}

SyncError records a driver that failed to install during sync.

type SyncProgressEvent

type SyncProgressEvent struct {
	// Phase is the current sync step: "resolving", "downloading", "verifying", or "installed".
	Phase string `json:"phase"`
	// Driver is the driver identifier being synced.
	Driver string `json:"driver"`
	// Bytes is the number of bytes transferred so far (downloading phase only).
	Bytes int64 `json:"bytes,omitempty"`
	// Total is the expected total byte count (downloading phase only).
	Total int64 `json:"total,omitempty"`
	// Version is the resolved version string (available after resolving phase).
	Version string `json:"version,omitempty"`
}

SyncProgressEvent is a single NDJSON line in the sync progress stream.

type SyncStatus

type SyncStatus struct {
	// Installed lists drivers that were newly installed.
	Installed []SyncedDriver `json:"installed"`
	// Skipped lists drivers that were already present and required no action.
	Skipped []SyncedDriver `json:"skipped"`
	// Errors lists drivers that failed to install.
	Errors []SyncError `json:"errors"`
}

SyncStatus is the final JSON payload emitted after a sync operation completes.

type SyncedDriver

type SyncedDriver struct {
	// Name is the driver identifier.
	Name string `json:"name"`
	// Version is the version that was installed or already present.
	Version string `json:"version"`
}

SyncedDriver records a driver that was successfully installed or skipped during sync.

type UninstallStatus

type UninstallStatus struct {
	// Status is the outcome: "success" or "error".
	Status string `json:"status"`
	// Driver is the driver identifier that was uninstalled.
	Driver string `json:"driver"`
}

UninstallStatus is the JSON payload emitted after a driver uninstallation. It corresponds to the inline format in cmd/dbc/uninstall.go.

Jump to

Keyboard shortcuts

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