Skip to content

한국어 | English

Go binding spec · Go binding guide

Go bindings reference

The writing rules follow the Reference-writing guide (Korean-only). This is the bindings layer (the Core C ABI's language projection) — not the framework layer, which has its own reference tree under framework/doc/framework/go/reference/.

Categories follow the .NET binding spec's Contract Folder Layout as the common architecture map. As with every wrapper binding so far, this tree has five categories, not six — contracts/ has no service.go; SPOT/Actor exists only at the framework layer.

contracts/ itself is a re-export shim — every type in contracts/*.go is a type X = impl.X alias and every function/const is a var/const pointing at internal/native (an unexported package). The actual method signatures documented in this tree are read from internal/native/*.go, not from contracts/, since the alias files carry no members of their own.

Go-specific notes carried into every category below:

  • Socket creation is a method on Context (ctx.PairSocket(), ctx.DealerSocket(), ...), not a free function at a package root — the only wrapper binding covered so far where this is a Context method rather than a top-level factory or a static-facade method.
  • No per-type option facade exists for Dealer/Router/Stream/Sub — their specific options (SetProbe, SetWeight, RequestTimeout, SetMandatory, SetHandover, SetConnectRoutingID, SetNotify/Notify, TopicsCount) are declared as direct methods on the socket type itself. Only CommonSocketOptions (via .CommonOptions()) and PubSocketOptions (via .PubOptions()) exist as separate accessor objects — every other language covered so far gives every socket type its own named options facade.
  • RequestOp has one completion-backed Go terminalSubmit(ctx) returns ([]*Message, error) after the socket completion queue yields the reply or terminal failure. Every send/request/reply Submit takes a context.Context; canceling it stops the Go waiter, but successful native submit has no Core cancellation operation. The socket owner continues to drain and settle that late completion. Use a separate goroutine when a public poller's PollCompletion wait loop owns completion draining.
  • ZlinkError is a Go interface, not a struct or enum — each typed error implements Error() string, Code() int, InternalErrno() int, and Unwrap() error (the standard-library errors.Is/errors.As integration point), per its own doc comment.

Locale convention

Every bindings/doc/spec/<lang>/ document is English-original, Korean-translation (unlike the framework's interface-catalog convention). This reference tree follows the same direction: write .en.md first, .ko.md second, and every spec citation links to the same-locale spec file.

Category

Category Status Contract source (contracts/*.go aliases → verified against internal/native/*.go)
Core Drafted contracts/core.gointernal/native/context.go, utility.go
Messaging Drafted contracts/messaging.gointernal/native/message.go, received.go, topic_message.go, subscription_event.go, operations.go, request_reply_types.go
Sockets Drafted contracts/sockets.gointernal/native/socket_core.go, socket_types.go, socket_options.go, connection_socket.go, socket_direct.go, socket_routed.go, socket_publish.go, socket_subscribe.go, socket_completion_control.go
Eventing Drafted contracts/eventing.gointernal/native/monitor.go, poller_timer.go
Errors Drafted contracts/errors.gointernal/native/error.go, result_codes.go

This document tree is wired into mkdocs.yml nav.