common

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodecInWrapperName

func GetCodecInWrapperName(name constant.CodecType) string

GetCodecInWrapperName get SerializeType of proto.TripleRequestWrapper from CodecType @name registered before

func GetTripleCodec

func GetTripleCodec(codecName constant.CodecType) (encoding.Codec, error)

GetTripleCodec get Codec impl by @codecName

func SetTripleCodec

func SetTripleCodec(codecType constant.CodecType, f CodecFactory, opt ...*config.Option)

SetTripleCodec register CodecFactory @f and CodecType @codecType, with @opt[0].SerializerTypeInWrapper

Types

type CodecFactory

type CodecFactory func() encoding.Codec

CodecFactory is Codec Factory

type DubboAttachment

type DubboAttachment map[string]interface{}

type ErrorWithAttachment

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

func NewErrorWithAttachment

func NewErrorWithAttachment(err error, attachments DubboAttachment) *ErrorWithAttachment

func (*ErrorWithAttachment) Error

func (e *ErrorWithAttachment) Error() string

func (*ErrorWithAttachment) GetAttachments

func (e *ErrorWithAttachment) GetAttachments() DubboAttachment

func (*ErrorWithAttachment) GetError

func (e *ErrorWithAttachment) GetError() error

type GenericCodec

type GenericCodec interface {
	UnmarshalRequest(data []byte) ([]interface{}, error)
}

type OuterResult

type OuterResult interface {
	// Result gets invoker result.
	Result() interface{}
	// Attachments gets all attachments
	Attachments() map[string]interface{}
}

OuterResult is a dubbo RPC result

type TripleError

type TripleError interface {
	Stacks() string
	Code() codes.Code
	Message() string
	GRPCStatus() *status.Status
}

type TripleGrpcReflectService

type TripleGrpcReflectService interface {
	SetGRPCServer(s *grpc.Server)
}

TripleGrpcReflectService is gRPC service, used to check impl

type TripleGrpcService

type TripleGrpcService interface {
	XXX_ServiceDesc() *grpc.ServiceDesc
}

TripleGrpcService is gRPC service, used to check impl

type TripleUnaryService

type TripleUnaryService interface {
	InvokeWithArgs(ctx context.Context, methodName string, arguments []interface{}) (interface{}, error)
	GetReqParamsInterfaces(methodName string) ([]interface{}, bool)
}

TripleUnaryService is normal protocol service (except grpc service), should be implemented by users

type TwoWayCodec

type TwoWayCodec interface {
	MarshalRequest(interface{}) ([]byte, error)
	MarshalResponse(interface{}) ([]byte, error)
	UnmarshalRequest(data []byte, v interface{}) error
	UnmarshalResponse(data []byte, v interface{}) error
}

TwoWayCodec is directly used by triple network logic It can specify the marshal and unmarshal logic of req and rsp

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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