schema

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelContractName    = "io.mb3r.bering.model"
	SnapshotContractName = "io.mb3r.bering.snapshot"

	ContractVersionV1_0_0 = "1.0.0"
	ContractVersionV1_1_0 = "1.1.0"
	LatestContractVersion = ContractVersionV1_1_0

	ExpectedSchemaName    = ModelContractName
	ExpectedSchemaVersion = LatestContractVersion
	ExpectedSchemaURI     = "https://mb3r-lab.github.io/Bering/schema/model/v1.1.0/model.schema.json"
	ExpectedSchemaDigest  = "sha256:bc9a60736c9e6bda9599243fd68f293b88f42ade65321d8267369a5c3214779a"

	ExpectedSnapshotSchemaName    = SnapshotContractName
	ExpectedSnapshotSchemaVersion = LatestContractVersion
	ExpectedSnapshotSchemaURI     = "https://mb3r-lab.github.io/Bering/schema/snapshot/v1.1.0/snapshot.schema.json"
	ExpectedSnapshotSchemaDigest  = "sha256:53b127608b2aaa4fabb352b998cd6b2c5ed558764729a09abea56f4f9b40fa01"
)

Variables

This section is empty.

Functions

func EmbeddedBytes added in v0.3.0

func EmbeddedBytes(ref SchemaRef) ([]byte, error)

func EmbeddedSchema

func EmbeddedSchema() []byte

func EmbeddedSchemaDigest

func EmbeddedSchemaDigest() string

func EmbeddedSnapshotSchema

func EmbeddedSnapshotSchema() []byte

func EmbeddedSnapshotSchemaDigest

func EmbeddedSnapshotSchemaDigest() string

func ResolveContractLine added in v0.3.0

func ResolveContractLine(version string) (SchemaRef, SchemaRef, error)

func SupportedContractVersions added in v0.3.0

func SupportedContractVersions() []string

func ValidateArtifactJSON

func ValidateArtifactJSON(raw []byte) error

func ValidateJSON

func ValidateJSON(raw []byte) error

func ValidateJSONVersion added in v0.3.0

func ValidateJSONVersion(raw []byte, version string) error

func ValidateSnapshotJSON

func ValidateSnapshotJSON(raw []byte) error

func ValidateSnapshotJSONVersion added in v0.3.0

func ValidateSnapshotJSONVersion(raw []byte, version string) error

func ValidateSnapshotStrict

func ValidateSnapshotStrict(ref SchemaRef) error

func ValidateStrict

func ValidateStrict(ref SchemaRef) error

Types

type PublishedContract added in v0.3.0

type PublishedContract struct {
	Ref          SchemaRef
	Artifact     string
	APIPath      string
	EmbeddedPath string
}

func LookupContract added in v0.3.0

func LookupContract(name, version string) (PublishedContract, bool)

func PublishedContracts added in v0.3.0

func PublishedContracts() []PublishedContract

type SchemaRef

type SchemaRef struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	URI     string `json:"uri"`
	Digest  string `json:"digest"`
}

func ExpectedRef

func ExpectedRef() SchemaRef

func ExpectedSnapshotRef

func ExpectedSnapshotRef() SchemaRef

func ExtractSchemaRef

func ExtractSchemaRef(raw []byte) (SchemaRef, error)

func ModelRef added in v0.3.0

func ModelRef(version string) (SchemaRef, bool)

func SnapshotRef added in v0.3.0

func SnapshotRef(version string) (SchemaRef, bool)

Jump to

Keyboard shortcuts

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