contracts

package
v0.0.0-...-1a39f93 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package contracts provides contract version validation for go-platform Ensures SSOT compliance by validating proto generation consistency

Index

Constants

View Source
const (
	// Expected minimum versions (should match contracts/Makefile)
	MinBufVersion = "v1.47.0"

	// Maximum age for generated code (hours)
	MaxGeneratedAge = 72
)

Variables

This section is empty.

Functions

func GetContractInfo

func GetContractInfo() map[string]interface{}

GetContractInfo returns contract information for health checks

func ValidateContractConsistency

func ValidateContractConsistency() error

ValidateContractConsistency performs deeper consistency checks

func ValidateContractVersion

func ValidateContractVersion() error

ValidateContractVersion validates proto generation version consistency Returns error if validation fails, causing startup to abort

Types

type VersionMetadata

type VersionMetadata struct {
	BufVersion  string    `json:"buf_version"`
	GeneratedAt time.Time `json:"generated_at"`
	ProtoHash   string    `json:"proto_hash"`
}

VersionMetadata represents the contract generation metadata

Jump to

Keyboard shortcuts

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