Documentation
¶
Index ¶
- func AwaitCommand() string
- func ComputeSchemaHash(path string) string
- func Initialize(name, version, typeStr string)
- func InjectCommand(cmd string)
- func SendEvent(jsonStr string)
- func SetSchemaHash(hash string)
- func StartHeartbeat(id, typeStr string)
- func StartQUIC(addr string) error
- type ChannelManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwaitCommand ¶
func AwaitCommand() string
AwaitCommand blocks until a command is received from the supervisor. Returns the command string (e.g. "start", "stop"). In a real implementation, this would read from a QUIC stream or IPC socket.
func ComputeSchemaHash ¶
ComputeSchemaHash reads a file and returns its BLAKE3 hash as a hex string. Returns empty string on error to simplify binding logic.
func Initialize ¶
func Initialize(name, version, typeStr string)
Initialize sets up the agent identity.
func InjectCommand ¶
func InjectCommand(cmd string)
InjectCommand is a helper for testing/simulation to push a command into the mailbox.
func SendEvent ¶
func SendEvent(jsonStr string)
SendEvent sends a generic event to the supervisor via QUIC.
func SetSchemaHash ¶
func SetSchemaHash(hash string)
SetSchemaHash sets the schema hash for the agent.
func StartHeartbeat ¶
func StartHeartbeat(id, typeStr string)
StartHeartbeat starts a background goroutine that sends heartbeat events.
Types ¶
type ChannelManager ¶
type ChannelManager struct {
// contains filtered or unexported fields
}
ChannelManager manages a string channel for native communication between Go and Python. It is designed to be exposed via gopy.
func NewChannelManager ¶
func NewChannelManager() *ChannelManager
NewChannelManager creates a new manager.
func (*ChannelManager) Receive ¶
func (m *ChannelManager) Receive(timeoutSeconds int) (string, error)
Receive blocks until a message is received or timeout. Returns the message and an error. If the channel is closed, returns error "channel closed". If timeout occurs, returns error "timeout".
func (*ChannelManager) Send ¶
func (m *ChannelManager) Send(msg string)
Send sends a message to the channel. It is safe to call from multiple goroutines (or Python threads).