reviewbridge

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolVersion = 1

Variables

This section is empty.

Functions

func Run

func Run(input io.Reader, output, errorOutput io.Writer, config Config) int

Run serves exactly one request over stdio. Exit 0 means the approved contract was written (or already identical), 2 means malformed/untrusted input, and 1 means a verified request could not be applied.

Types

type Config

type Config struct {
	Verifier spatialcontract.ApprovalVerifier
	Consumer spatialcontract.ApprovalGrantConsumer
	Ledger   *reviewgrant.Ledger
}

type Request

type Request struct {
	ProtocolVersion int                              `json:"protocol_version"`
	Action          string                           `json:"action"`
	ProjectRoot     string                           `json:"project_root"`
	CurrentPath     string                           `json:"current_path"`
	CurrentHash     string                           `json:"current_hash"`
	DraftPath       string                           `json:"draft_path"`
	Reviewer        string                           `json:"reviewer"`
	Grant           spatialcontract.ApprovalEvidence `json:"grant"`
}

type Response

type Response struct {
	OK           bool   `json:"ok"`
	Status       string `json:"status,omitempty"`
	CurrentPath  string `json:"current_path,omitempty"`
	Backup       string `json:"backup,omitempty"`
	ContractHash string `json:"contract_hash,omitempty"`
	Written      bool   `json:"written,omitempty"`
	Error        string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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