Documentation
¶
Index ¶
- type Handler
- type InvokeError
- type Table
- func (r *Table) Dispatch(ctx *cfacade.RequestContext, methodID uint32, body []byte, ...) *cfacade.InvokeResult
- func (r *Table) MsgType(methodID uint32) (cproto.MsgType, bool)
- func (r *Table) Register(methodID uint32, target string, msgType cproto.MsgType) error
- func (r *Table) Target(methodID uint32) (string, bool)
- func (r *Table) UnregisterTarget(target string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
MsgType cproto.MsgType
RequestGoType reflect.Type
Protobuf bool
Invoke cfacade.TypedInvoke
}
Handler describes a validated Actor method for mailbox installation.
func AdaptHandler ¶
AdaptHandler validates handler signatures and returns invoke metadata used by Actor mailboxes to decode raw transport bodies.
type InvokeError ¶
type InvokeError struct {
Code cproto.StatusCode
Message string
}
InvokeError lets an Actor handler return a protocol status instead of the generic STATUS_INTERNAL used for ordinary errors.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table is the application-wide MethodID catalog populated by Actor.Methods().Register. A top-level MethodID also records its ActorPath, so ordinary callers only need the MethodID. Body decoding happens in the Actor mailbox.
func NewTable ¶
func NewTable(app cfacade.IApplication) *Table
NewTable creates an empty application-scoped method table.
func (*Table) Dispatch ¶
func (r *Table) Dispatch(ctx *cfacade.RequestContext, methodID uint32, body []byte, msgType cproto.MsgType) *cfacade.InvokeResult
Dispatch validates the registered message type and invokes the top-level Actor selected by MethodID with the raw transport body.
func (*Table) MsgType ¶
MsgType returns the protocol message type inferred from the handler signature.
func (*Table) Register ¶
Register records one externally routable top-level Actor method. Handler reflection and body decoding remain private to the Actor mailbox.
func (*Table) UnregisterTarget ¶
UnregisterTarget removes catalog entries when a top-level Actor stops.