Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to a remote event stream broker on port 1002.
func Subscribe ¶
Subscribe connects to the event stream and subscribes to a topic. Use "*" to subscribe to all events.
type Event ¶
Event is a typed message published to the event stream. Wire format: [2-byte topic length][topic][4-byte payload length][payload]
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a pub/sub event broker on port 1002. Clients connect, subscribe to topics, and publish events. The first event from a client is treated as a subscription: - Topic "*" subscribes to all events - Any other topic subscribes to that specific topic Subsequent events are published to all matching subscribers.
func (*Server) ListenAndServe ¶
ListenAndServe binds port 1002 and starts the broker.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the L11 plugin adapter. cmd/daemon/main.go (L12) and cmd/pilotctl _daemon-run construct it via NewService and register via daemon.RegisterPlugin.
func NewService ¶
func NewService() *Service
NewService returns a Service ready for daemon.RegisterPlugin.
func (*Service) Order ¶
Order: 120 — after the trust subsystem (50) and other application services that may want to publish before the broker is up.
func (*Service) SetTopicPolicy ¶ added in v0.2.3
func (s *Service) SetTopicPolicy(p TopicPolicy)
SetTopicPolicy installs a TopicPolicy for subscription authorization. Must be called before Start. A nil value is ignored (policy stays at the previous setting, which defaults to allow-all).
type TopicPolicy ¶ added in v0.2.3
type TopicPolicy interface {
// AllowSubscribe returns true if the peer at remoteAddr is
// permitted to subscribe to the named topic.
AllowSubscribe(remoteAddr coreapi.Addr, topic string) bool
}
TopicPolicy is the authorization gate for topic subscription. Implementations check whether a peer (identified by its 48-bit virtual address) may subscribe to a given topic.
The defaultAllowPolicy permits all subscriptions (backward compatible). Daemon-level callers that need topic-level access control provide a restricted implementation via SetTopicPolicy.