Documentation
¶
Index ¶
- type RPCResult
- func (r *RPCResult) AddAttachment(key string, value any)
- func (r *RPCResult) Attachment(key string, defaultValue any) any
- func (r *RPCResult) Attachments() map[string]any
- func (r *RPCResult) BizError() error
- func (r *RPCResult) Error() error
- func (r *RPCResult) Result() any
- func (r *RPCResult) SetAttachments(attr map[string]any)
- func (r *RPCResult) SetBizError(err error)
- func (r *RPCResult) SetError(err error)
- func (r *RPCResult) SetResult(rest any)
- func (r *RPCResult) String() string
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCResult ¶
RPCResult is default RPC result.
func (*RPCResult) AddAttachment ¶
AddAttachment adds the specified map to existing attachments in this instance.
func (*RPCResult) Attachment ¶
Attachment gets attachment by key with default value.
func (*RPCResult) Attachments ¶
Attachments gets all attachments
func (*RPCResult) BizError ¶
BizError gets error. Replaced with error code in triple protocol since 3.2.0
func (*RPCResult) SetAttachments ¶
SetAttachments replaces the existing attachments with the specified param.
type Result ¶
type Result interface {
SetError(error)
Error() error
SetResult(any)
Result() any
SetAttachments(map[string]any)
Attachments() map[string]any
AddAttachment(string, any)
Attachment(string, any) any
}
Result is a interface that represents RPC result
SetError method sets error.
Error method gets error.
SetResult method sets invoker result.
Result method gets invoker result.
SetAttachments method replaces the existing attachments with the specified param.
Attachments method gets all attachments ¶
AddAttachment method adds the specified map to existing attachments in this instance.
Attachment method gets attachment by key with default value.