contract

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package contract checks the live AudD services against the shapes the CLI relies on. It runs on a schedule (.github/workflows/contract.yml), never in the normal test suite:

go test -tags contract ./internal/contract/ -v

Each check is skipped when its credentials are not set:

AUDD_CONTRACT_API_TOKEN      an API token for a test account (CI only)
AUDD_CONTRACT_RADIO_ID       a stream on that account, for recent results
AUDD_CONTRACT_OAUTH_SESSION  the JSON session `audd login` stores (secret
                             key "oauth"), for the account tool schemas
AUDD_CONTRACT_SESSION_OUT    where to write the refreshed session, so a
                             single-use refresh token can be saved back
AUDD_CONTRACT_SCHEMAS_OUT    where to write every live tool's output
                             schema as JSON, keyed by tool name

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SchemaDiff

func SchemaDiff(path string, want, got map[string]any) (diffs, notes []string)

SchemaDiff compares what the CLI expects (want) with the live schema (got), recursively through objects and arrays. diffs are the changes that break the CLI: a field it requires that is missing or no longer required, and type changes. notes are fields the CLI reads leniently that the live schema lacks; the CLI still works without them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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