clients

package
v1.785.15 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package clients holds the canonical ZAP-typed inter-subsystem clients used by cloud.Deps.

Per HIP-0106 "Inter-subsystem contract": ZAP (the Hanzo native binary protocol). Every subsystem ships its public interface as a .zap schema; zapc generates Go bindings; cloud wires the in-process ZAP-typed Go interfaces when subsystems are co-resident, falls back to ZAP RPC over the wire when split.

This package provides three factories per subsystem:

  • <Subsystem>InProcess(impl): wraps a co-resident implementation as a ZAP-typed client. Direct Go method calls. No marshalling, no network.

  • <Subsystem>RPC(addr): builds a ZAP-RPC client targeting a remote endpoint (used in split deployments).

  • Disabled<Subsystem>(): returns a typed nil that fails closed with a clear error message when called. Lets subsystem mount code defensively detect "the dep isn't wired" without nil dereferences.

cloud.BuildDeps picks the right one for each subsystem based on cfg.Enabled(name) and the configured RPC endpoint.

Note (zapc): the ZAP RPC wire format is exercised by hanzoai/zap (Rust impl) and hanzoai/zap-go (Go bindings). The current Go scaffolding here ships stubs sufficient to enforce the contract; the actual RPC dispatch sits behind a transport layer that subsystems will swap in as each subsystem ships its .zap schema + zapc-generated client. TODO(zapc-gen) markers identify the expansion points.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AIInProcess

func AIInProcess(impl types.AIClient) types.AIClient

AIInProcess wraps a co-resident AI implementation.

func AIRPCAt

func AIRPCAt(addr string) types.AIClient

AIRPCAt returns a ZAP-RPC AI client targeting addr.

func BaseInProcess

func BaseInProcess(impl types.BaseClient) types.BaseClient

BaseInProcess wraps a co-resident Base implementation.

func BaseRPCAt

func BaseRPCAt(addr string) types.BaseClient

BaseRPCAt returns a ZAP-RPC Base client targeting addr.

func CommerceInProcess

func CommerceInProcess(impl types.CommerceClient) types.CommerceClient

CommerceInProcess wraps a co-resident Commerce implementation.

func CommerceRPCAt

func CommerceRPCAt(addr string) types.CommerceClient

CommerceRPCAt returns a ZAP-RPC Commerce client targeting addr.

func DisabledAI

func DisabledAI() types.AIClient

DisabledAI returns a fail-closed AI client.

func DisabledBase

func DisabledBase() types.BaseClient

DisabledBase returns a fail-closed Base client.

func DisabledCommerce

func DisabledCommerce() types.CommerceClient

DisabledCommerce returns a fail-closed Commerce client.

func DisabledIAM

func DisabledIAM() types.IAMClient

DisabledIAM returns a fail-closed IAM client.

func DisabledKMS

func DisabledKMS() types.KMSClient

DisabledKMS returns a fail-closed KMS client.

func DisabledMQ

func DisabledMQ() types.MQClient

DisabledMQ returns a fail-closed MQ client.

func DisabledO11y

func DisabledO11y() types.O11yClient

DisabledO11y returns an O11y client that emits to /dev/null. Used when o11y isn't mounted; subsystems get no-op metrics rather than nil deref or error spam.

func DisabledPayments

func DisabledPayments() types.PaymentsClient

DisabledPayments returns a fail-closed Payments client.

func DisabledVFS

func DisabledVFS() types.VFSClient

DisabledVFS returns a fail-closed VFS client.

func DisabledVault

func DisabledVault() types.VaultClient

DisabledVault returns a fail-closed Vault client.

func IAMInProcess

func IAMInProcess(impl types.IAMClient) types.IAMClient

IAMInProcess wraps a co-resident IAM implementation. Subsystems call deps.IAM.VerifyJWT(...) etc. without knowing whether IAM is in-process or remote.

func IAMRPCAt

func IAMRPCAt(addr string) types.IAMClient

IAMRPCAt returns a ZAP-RPC IAM client targeting addr.

func IsDisabled

func IsDisabled(err error) bool

IsDisabled reports whether err originated from a disabled client. Subsystem mount code can use this to log a friendly warning instead of cascading a 500.

func KMSInProcess

func KMSInProcess(impl types.KMSClient) types.KMSClient

KMSInProcess wraps a co-resident KMS implementation.

func KMSRPCAt

func KMSRPCAt(addr string) types.KMSClient

KMSRPCAt returns a ZAP-RPC KMS client targeting addr.

func MQInProcess

func MQInProcess(impl types.MQClient) types.MQClient

MQInProcess wraps a co-resident MQ implementation.

func MQRPCAt

func MQRPCAt(addr string) types.MQClient

MQRPCAt returns a ZAP-RPC MQ client targeting addr.

func O11yInProcess

func O11yInProcess(impl types.O11yClient) types.O11yClient

O11yInProcess wraps a co-resident O11y implementation.

func O11yRPCAt

func O11yRPCAt(addr string) types.O11yClient

O11yRPCAt returns a ZAP-RPC O11y client targeting addr.

func PaymentsRPCAt

func PaymentsRPCAt(addr string) types.PaymentsClient

PaymentsRPCAt returns a ZAP-RPC Payments client targeting addr. Payments is ALWAYS split-deployed (PCI scope isolation per HIP-0106 solo-vault CDE), so there is no in-process variant.

func VFSInProcess

func VFSInProcess(impl types.VFSClient) types.VFSClient

VFSInProcess wraps a co-resident VFS implementation.

func VFSRPCAt

func VFSRPCAt(addr string) types.VFSClient

VFSRPCAt returns a ZAP-RPC VFS client targeting addr.

func VaultRPCAt

func VaultRPCAt(addr string) types.VaultClient

VaultRPCAt returns a ZAP-RPC Vault client targeting addr. Vault is ALWAYS split-deployed (PCI-CDE, the only system that touches PAN), so there is no in-process variant.

Types

This section is empty.

Directories

Path Synopsis
Package gojahost runs a Hanzo Node service's goja bundle (a self-contained, ESM-free JS file exposing globalThis.handle(req)) inside the unified cloud binary, per HIP-0106.
Package gojahost runs a Hanzo Node service's goja bundle (a self-contained, ESM-free JS file exposing globalThis.handle(req)) inside the unified cloud binary, per HIP-0106.
Package plansvc mounts the @hanzo/plans catalog into the unified cloud binary under /v1/plans/*, per HIP-0106.
Package plansvc mounts the @hanzo/plans catalog into the unified cloud binary under /v1/plans/*, per HIP-0106.
Package pricingsvc mounts the @hanzo/pricing service into the unified cloud binary under /v1/pricing/* (+ the /v1/models, /v1/gpu, /v1/tools aliases), per HIP-0106.
Package pricingsvc mounts the @hanzo/pricing service into the unified cloud binary under /v1/pricing/* (+ the /v1/models, /v1/gpu, /v1/tools aliases), per HIP-0106.

Jump to

Keyboard shortcuts

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