Help us shape the future of Go! Take the 2026 Go Developer Survey

gateresponse

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gateresponse reads a gate_response command's private body, the one rule both of its readers share.

TWO READERS, ONE RULE, AND THE ORDER BETWEEN THEM IS THE POINT. The applier reads the body BEFORE it authorizes a dispatch attempt, to refuse a body no Host could ever apply while the command is still pending or claimed and a rejection is still possible. The runtime adapter reads it AFTER, to build harness's decoded answer. If the two applied different rules, a body the first accepted and the second refused would fail after the attempt was durable — and once an attempt exists nothing settles a command except the runtime's own evidence, which a refused dispatch never writes. Sharing the function is what makes that ordering safe.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyBody = errors.New("gateresponse: the command carries no inline body")

ErrEmptyBody is the cause of a MalformedError for a command with no inline body. A body stored behind an object reference is not this error: its bytes exist, this Host does not dereference them, and that is the caller's to say.

Functions

This section is empty.

Types

type MalformedError

type MalformedError struct {
	Reason string
	Cause  error
}

MalformedError reports a body no Host can ever apply. It is PERMANENT: the body is immutable once admitted, so a retry, or another Host, reads the same bytes and reaches the same answer.

func (*MalformedError) Error

func (e *MalformedError) Error() string

func (*MalformedError) Unwrap

func (e *MalformedError) Unwrap() error

Unwrap returns the lower-level failure, if any.

type Response

type Response struct {
	// Request is the Core record Factory admitted, strictly decoded and
	// validated.
	Request sessionwire.GateResponseRequest

	// GateID is the Core gate identity as harness's gate identity: a non-zero
	// UUID, because harness mints every gate id as one.
	GateID uuid.UUID
}

Response is one decoded gate_response body.

func Decode

func Decode(body []byte, session sessionwire.SessionID, command sessionwire.CommandID) (Response, error)

Decode reads one gate_response body admitted for (session, command).

It is Core's strict decoder and Core's validation — exactly one expected-open version, a non-empty action, non-nil values — plus the two things only the reader of a STORED body can check: that the body names the session and the command it is stored under, and that its gate identity is one harness could have minted.

Jump to

Keyboard shortcuts

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