protos

package
v0.0.0-...-5ecabc5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NatsRpcErrorKey = "NatsRpcError"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeMessageError

type CodeMessageError interface {
	GetCode() string
	GetMessage() string
}

type DetailsError

type DetailsError interface {
	CodeMessageError
	GetDetails() any
}

type Request

type Request struct {
	ServiceMethod string          `json:"serviceMethod"`
	Args          json.RawMessage `json:"args"`
}

func (*Request) Encode

func (me *Request) Encode() []byte

type Response

type Response struct {
	Error  *RpcError       `json:"error,omitempty"`
	Result json.RawMessage `json:"result,omitempty"`
}

func (*Response) Encode

func (me *Response) Encode() []byte

type RpcError

type RpcError struct {
	// contains filtered or unexported fields
}

func FromError

func FromError(err error) *RpcError

func NewRpcError

func NewRpcError(opts ...any) *RpcError

func ParseRpcError

func ParseRpcError() *RpcError

func (*RpcError) Error

func (me *RpcError) Error() string

func (*RpcError) GetCode

func (me *RpcError) GetCode() string

func (*RpcError) GetDetails

func (me *RpcError) GetDetails() any

func (*RpcError) GetMessage

func (me *RpcError) GetMessage() string

func (*RpcError) UnmarshalJSON

func (me *RpcError) UnmarshalJSON(b []byte) error

only accept string

Jump to

Keyboard shortcuts

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