result

package
v3.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCResult

type RPCResult struct {
	Attrs  map[string]any
	BizErr error
	Err    error
	Rest   any
}

RPCResult is default RPC result.

func (*RPCResult) AddAttachment

func (r *RPCResult) AddAttachment(key string, value any)

AddAttachment adds the specified map to existing attachments in this instance.

func (*RPCResult) Attachment

func (r *RPCResult) Attachment(key string, defaultValue any) any

Attachment gets attachment by key with default value.

func (*RPCResult) Attachments

func (r *RPCResult) Attachments() map[string]any

Attachments gets all attachments

func (*RPCResult) BizError

func (r *RPCResult) BizError() error

BizError gets error. Replaced with error code in triple protocol since 3.2.0

func (*RPCResult) Error

func (r *RPCResult) Error() error

Error gets error.

func (*RPCResult) Result

func (r *RPCResult) Result() any

Result gets invoker result.

func (*RPCResult) SetAttachments

func (r *RPCResult) SetAttachments(attr map[string]any)

SetAttachments replaces the existing attachments with the specified param.

func (*RPCResult) SetBizError

func (r *RPCResult) SetBizError(err error)

SetBizError sets error.

func (*RPCResult) SetError

func (r *RPCResult) SetError(err error)

SetError sets error.

func (*RPCResult) SetResult

func (r *RPCResult) SetResult(rest any)

SetResult sets invoker result.

func (*RPCResult) String

func (r *RPCResult) String() string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL