edgeclient

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package edgeclient is the bounded client for Snagline's local edge API. It intentionally has no SQLite, SSP, PostgreSQL, NATS, or Buzz access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckRequest

type AckRequest struct {
	Front                            Front
	MessageID, ClaimToken, ReceiptID string
}

type AdviceView added in v0.1.2

type AdviceView struct {
	AdviceID   string
	CaseID     string
	Text       string
	ReceivedAt time.Time
}

type CaseRecord added in v0.1.2

type CaseRecord struct {
	EnvelopeID string
	CaseID     string
	Commitment string
	Summary    string
	Registry   RegistryCoordinates
	ExpiresAt  time.Time
	Committed  bool
}

CaseRecord mirrors GET /v1/cases/{id}. AdviceView mirrors one advice from GET /v1/cases/{id}/advice. Both carry the server's default JSON field names.

type CaseSubmission added in v0.1.2

type CaseSubmission struct {
	EnvelopeID     string
	CaseID         string
	Commitment     string
	AcceptedRemote bool
	Receipt        CommitReceipt
}

type ClaimRequest

type ClaimRequest struct {
	Front    Front
	Owner    string
	LeaseTTL time.Duration
	Limit    int
}

type Client

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

func New

func New(config Config) (*Client, error)

func (*Client) Ack

func (c *Client) Ack(ctx context.Context, request AckRequest) (DeliveryOutcome, error)

func (*Client) Claim

func (c *Client) Claim(ctx context.Context, request ClaimRequest) ([]Delivery, error)

func (*Client) CloseIdleConnections

func (c *Client) CloseIdleConnections()

func (*Client) GetCase added in v0.1.2

func (c *Client) GetCase(ctx context.Context, caseID string) (CaseRecord, error)

GetCase reads a case record. It performs no mutation.

func (*Client) ListAdvice added in v0.1.2

func (c *Client) ListAdvice(ctx context.Context, caseID string) ([]AdviceView, error)

ListAdvice lists the advice recorded for a case. A case receives at most one final advice, and may receive none, so an empty list is a valid answer.

func (*Client) OpenCase added in v0.1.2

func (c *Client) OpenCase(ctx context.Context, request OpenCaseRequest) (CaseSubmission, error)

OpenCase submits a new case. The edge accepts it with 202; anything else is an error. The caller supplies registry coordinates from deployment configuration.

func (*Client) RetryCase added in v0.1.2

func (c *Client) RetryCase(ctx context.Context, caseID string) (CaseSubmission, error)

RetryCase asks the edge to resubmit its already-spooled exact bytes once. It accepts no mutable case input beyond the deployment-bound case ID.

type CommitReceipt added in v0.1.2

type CommitReceipt struct {
	AuthorityID string
	Revision    int64
	EnvelopeID  string
	Commitment  string
}

CommitReceipt and CaseSubmission mirror the edge's 202 response for an accepted case. Field names match the server's default JSON marshaling.

type Config

type Config struct{ Socket string }

type Delivery

type Delivery struct {
	CaseID     string `json:"case_id"`
	AdviceID   string `json:"advice_id"`
	MessageID  string `json:"message_id"`
	Text       string `json:"text"`
	ClaimToken string `json:"claim_token"`
}

type DeliveryOutcome

type DeliveryOutcome string
const (
	DeliveryRecorded  DeliveryOutcome = "recorded"
	DeliveryDuplicate DeliveryOutcome = "duplicate"
)

type Front

type Front string
const (
	FrontCLI Front = "cli"
	FrontAMQ Front = "amq"
)

type OpenCaseRequest added in v0.1.2

type OpenCaseRequest struct {
	CaseID          string
	Domain          string
	Summary         string
	PublicSummary   string
	ContextManifest string
	Registry        RegistryCoordinates
}

OpenCaseRequest is the bounded input for opening a case. PublicSummary is the only field projected to Buzz; Summary stays confidential to the fabric.

type RegistryCoordinates added in v0.1.2

type RegistryCoordinates struct {
	RoutingEpoch int64  `json:"routing_epoch"`
	Revision     int64  `json:"revision"`
	Hash         string `json:"hash"`
}

RegistryCoordinates bind a case to a specific registry generation. They are deployment-owned inputs: the edge exposes no route to discover them, so a caller must receive them from trusted deployment configuration.

Jump to

Keyboard shortcuts

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