machine

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliveryClaim

type DeliveryClaim struct {
	State               DeliveryClaimState
	ExistingResponse    protocol.MachineResponse
	ExistingResolved    bool
	ExistingAmbiguous   bool
	ExistingFingerprint string
}

type DeliveryClaimState

type DeliveryClaimState int
const (
	DeliveryClaimStateNew DeliveryClaimState = iota
	DeliveryClaimStateIdenticalPending
	DeliveryClaimStateIdenticalResolved
	DeliveryClaimStateChangedConflict
	DeliveryClaimStateCapacity
)

type DeliveryIdentity

type DeliveryIdentity struct {
	Identity    string
	Fingerprint string
}

type DeliveryIdentityFromSendNudge

type DeliveryIdentityFromSendNudge struct{}

func (DeliveryIdentityFromSendNudge) Identity

type DeliveryIdentityResolver

type DeliveryIdentityResolver interface {
	Identity(request protocol.MachineRequest) (DeliveryIdentity, bool)
}

type DeliveryRegistry

type DeliveryRegistry interface {
	Claim(identity DeliveryIdentity) (DeliveryClaim, error)
	Resolve(identity DeliveryIdentity, response protocol.MachineResponse, ambiguous bool) bool
	Release(identity DeliveryIdentity) bool
	Lookup(identity DeliveryIdentity) (protocol.MachineResponse, bool)
	Size() int
}

func NewDeliveryRegistry

func NewDeliveryRegistry(max int) DeliveryRegistry

NewDeliveryRegistry constructs the one bounded registry shared by a Session and its ProviderExecutor. Callers must inject this same value into both.

type DeliveryService

type DeliveryService struct {
	// contains filtered or unexported fields
}

DeliveryService records only outcomes that packet 1 cannot infer safely. A release is legal solely before SendMessage is invoked or after an explicit accepted=false response; every post-send uncertainty is retained by packet 1.

func NewDeliveryService

func NewDeliveryService(registry DeliveryRegistry) *DeliveryService

type Executor

type Executor interface {
	Execute(ctx context.Context, request protocol.MachineRequest) (protocol.MachineResponse, error)
}

type Provider

Provider is the narrow, credential-free dependency used by the machine executor. It deliberately mirrors only the client operations machine needs.

type ProviderExecutor

type ProviderExecutor struct {
	// contains filtered or unexported fields
}

ProviderExecutor is the concrete packet-2 Executor. It has no HTTP or credential fields: Provider owns transport and DeliveryService owns the shared packet-1 reservation lifecycle.

func NewProviderExecutor

func NewProviderExecutor(attachment clientconfig.AttachmentConfig, provider Provider, registry DeliveryRegistry) *ProviderExecutor

func (*ProviderExecutor) Execute

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(ctx context.Context, input io.ReadCloser, writer io.Writer, opts ...SessionOption) *Session

func (*Session) Run

func (session *Session) Run() error

type SessionOption

type SessionOption func(*Session)

func WithDeliveryIdentityResolver

func WithDeliveryIdentityResolver(resolver DeliveryIdentityResolver) SessionOption

func WithDeliveryRegistry

func WithDeliveryRegistry(registry DeliveryRegistry) SessionOption

func WithExecutor

func WithExecutor(executor Executor) SessionOption

Jump to

Keyboard shortcuts

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