contract

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version string

Version represents an API version identifier.

const (
	V1     Version = "1"
	Latest Version = V1
)

func Apply

func Apply(ctx context.Context, conn *pgxpool.Conn, version string) (Version, error)

Apply executes the API contract SQL for the specified version. This creates the public views and functions that deploy.sql depends on. Must be called after schema.sql and file loading.

func LatestVersion

func LatestVersion() Version

LatestVersion returns the current latest API version.

func Load

func Load(version string) (string, Version, error)

Load returns the SQL content for the specified API version. If version is empty, the latest version is used. Returns the SQL content, the resolved version, and any error.

func SupportedVersions

func SupportedVersions() []Version

SupportedVersions returns a sorted list of all supported API versions.

Jump to

Keyboard shortcuts

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