Documentation
¶
Overview ¶
Package zap adds the HIP-0110 ZAP server surface to Hanzo Base.
Base already speaks ZAP via plugins/zap (Collections=100, Records=101, Auth=102, Realtime=103). HIP-0110 adds upper-half handlers that share the same socket:
MsgTypeForward (0x1010) — gateway → base request. Decoded and
delegated to a pluggable Dispatcher.
MsgTypeSubscribe (0x1030) — gateway → base subscription registration.
Future record changes for the collection
produce MsgTypePush envelopes routed to
the right gateway peer.
No new pubsub; reuses base's realtime subscription pattern.
Index ¶
Constants ¶
const ( MsgTypeForward uint16 = 0x80 MsgTypePush uint16 = 0x81 MsgTypeSubscribe uint16 = 0x82 )
HIP-0110 message-type IDs. Mirror github.com/hanzoai/gateway/zap_wire.go. zap.FinishWithFlags expects the type in the upper byte of a uint16 (`type << 8`), so types must fit in uint8. Picked in the 0x80+ range so they don't collide with base/plugins/zap's lower-byte IDs (Collections=100, Records=101, Auth=102, Realtime=103).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface {
Dispatch(ctx context.Context, f Forward) (status uint32, headers, body []byte, err error)
}
Dispatcher routes a Forward envelope to a matching base handler.
type Forward ¶
type Forward struct {
TenantID, UserID string
IsAdmin bool
Permissions int64
Method, Path, ConnID string
Headers, Body []byte
}
Forward is the parsed envelope handed to the per-path dispatcher.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server adds the HIP-0110 surface to a base instance.
func NewServer ¶
NewServer constructs the HIP-0110 add-on. `node` is reused from base's plugins/zap so legacy and HIP-0110 IDs share one socket.