Documentation
¶
Index ¶
- Constants
- Variables
- func CreateClientTLSConfig(cfg TLSConfig) (*tls.Config, error)
- func GenerateInsecureSelfSignedCert() (tls.Certificate, error)
- func NewClientFromConfig(cfg config.TransportConfig) (eventbus.Transport[*anypb.Any], error)
- func NewLocal() eventbus.Transport[*anypb.Any]
- func NewQUICClientTransport(cfg config.TransportConfig) (eventbus.Transport[*anypb.Any], error)
- func NewQUICServerTransport(addr, tlsCert, tlsKey string) (eventbus.Transport[*anypb.Any], error)
- func NewServerFromConfig(cfg config.TransportConfig) (eventbus.Transport[*anypb.Any], error)
- type Local
- type PeerSendError
- type PublishIncomplete
- type QUIC
- type TLSConfig
- type Transport
Constants ¶
const ALPNGapiQUIC = "gapi-quic"
ALPNGapiQUIC is the ALPN protocol identifier for the kernel's QUIC transport. It mirrors the ecosystem ALPN registry as its governing contract (append-only, tombstoned): a collision is a review failure, not a runtime discovery. Consumers (the orchestrator's ALPN router) import this constant and never redefine the literal (GAPI-DIV-011).
Variables ¶
var ErrEnvelopeTooLarge = errors.New("transport: envelope too large to frame")
ErrEnvelopeTooLarge reports an envelope whose byte length cannot be expressed in the four-byte frame prefix. It is OURS, not the network's - nothing was written and nothing failed on the wire - so it is a sentinel here rather than a wrapped transport error.
Functions ¶
func CreateClientTLSConfig ¶
CreateClientTLSConfig builds a tls.Config from the provided settings
func GenerateInsecureSelfSignedCert ¶
func GenerateInsecureSelfSignedCert() (tls.Certificate, error)
GenerateInsecureSelfSignedCert generates a self-signed cert for testing/insecure modes.
func NewClientFromConfig ¶
Config-driven client.
func NewQUICClientTransport ¶
QUIC client transport.
func NewQUICServerTransport ¶
QUIC server transport.
func NewServerFromConfig ¶
Config-driven server.
Types ¶
type Local ¶
type Local[T any] struct { // contains filtered or unexported fields }
Local provides an in-proc "loopback" transport used for testing or single-process mode.
func (*Local[T]) OnRemoteEvent ¶
type PeerSendError ¶
PeerSendError reports one peer's failed send.
func (*PeerSendError) Error ¶
func (e *PeerSendError) Error() string
func (*PeerSendError) Unwrap ¶
func (e *PeerSendError) Unwrap() error
type PublishIncomplete ¶
type PublishIncomplete struct {
// Peers is how many peers the publish addressed.
Peers int
// Failed is how many reported a named error.
Failed int
// Unconfirmed is how many had not answered when the window closed.
Unconfirmed int
// Errs holds one PeerSendError per failed peer.
Errs []error
}
PublishIncomplete reports a remote publish that did not confirm delivery to every peer.
FAILED AND UNCONFIRMED ARE DIFFERENT FACTS AND ARE COUNTED SEPARATELY. A failed peer reached a named error; an unconfirmed one had not finished when the confirmation window closed, and its send may still complete afterwards. Collapsing the two would make the error say "this did not arrive" where the honest claim is "this is not known to have arrived".
func (*PublishIncomplete) Error ¶
func (e *PublishIncomplete) Error() string
func (*PublishIncomplete) Unwrap ¶
func (e *PublishIncomplete) Unwrap() []error
Unwrap returns the per-peer errors so errors.Is and errors.As reach them. Only FAILED peers appear here; an unconfirmed peer has no error to report, which is precisely what makes it unconfirmed.
type QUIC ¶
type QUIC struct {
// contains filtered or unexported fields
}
func NewQUICClient ¶
func NewQUICServer ¶
func NewQUICServer(addr string, cert tls.Certificate) (*QUIC, error)
func (*QUIC) Addr ¶
Addr reports the address the listener ACTUALLY BOUND, which is not always the one it was asked for: ":0" resolves to a kernel-assigned port, and a configured hostname may resolve to something else. The daemon is the only party that knows this value, which is why it has to be published rather than re-derived by the client (GAPI-DIV-070).
Empty for a client QUIC, which has no listener. Takes q.mu because Close() nils the field.
func (*QUIC) PeerCount ¶
PeerCount reports how many connections this transport would address. Exported for tests: "the publish reached both peers" is only a meaningful assertion once "both peers are attached" can be awaited rather than slept on.
func (*QUIC) PublishRemote ¶
PublishRemote sends one event to every attached peer and reports whether the bytes went out.
A nil RETURN NOW ASSERTS DELIVERY TO THE WIRE, AND IT PREVIOUSLY ASSERTED NOTHING. This function used to spawn a goroutine per peer and return nil immediately, so nil meant "some work was scheduled" - and measured on gapi #136, sometimes not even that: ten failing gapictl clients logged `event=dial` and NOT ONE reached the send goroutine's first line. The client gave up on its 2s deadline and exited before the runtime scheduled the goroutine, so OpenStreamSync never ran, nothing was written, and no error path was reached. That is why all seven of the send path's error paths reported zero while requests demonstrably vanished: nothing was failing, nothing was happening.
WHAT nil MEANS, STATED PRECISELY, BECAUSE THE WHOLE DEFECT WAS AN OVERCLAIMED RETURN VALUE: every peer's frame was marshalled, written and its write side closed. It does NOT mean any peer acknowledged or handled the event - this layer cannot know that, and a return value that implied it would repeat the mistake one level up.
THE FAN-OUT IS UNCHANGED; ONLY THE WAITING IS NEW. The sends still run concurrently, one goroutine per peer, so no peer's send is sequenced behind another's timeout and a publish reaching some peers and not others still does not depend on their order. What the old comment defended - one unresponsive peer must not block every publisher - is preserved by the concurrency plus the bounded window below, not by refusing to wait at all.