triple

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: 26 Imported by: 64

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericCodec

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

GenericCodec is pb impl of TwoWayCodec

func (*GenericCodec) UnmarshalRequest

func (h *GenericCodec) UnmarshalRequest(data []byte) ([]interface{}, error)

UnmarshalRequest unmarshal bytes @data to interface

type TripleClient

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

TripleClient client endpoint that using triple protocol

func NewTripleClient

func NewTripleClient(impl interface{}, opt *config.Option) (*TripleClient, error)

NewTripleClient creates triple client it returns tripleClient, which contains invoker and triple connection. @impl must have method: GetDubboStub(cc *dubbo3.TripleConn) interface{}, to be capable with grpc @opt is used to init http2 controller, if it's nil, use the default config

func (*TripleClient) Close

func (t *TripleClient) Close()

Close destroy http controller and return

func (*TripleClient) Invoke

func (t *TripleClient) Invoke(methodName string, in []reflect.Value, reply interface{}) common.ErrorWithAttachment

Invoke call remote using stub

func (*TripleClient) IsAvailable

func (t *TripleClient) IsAvailable() bool

IsAvailable returns if triple client is available

type TripleConn

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

TripleConn is the struct that called in pb.go file Its client field contains all net logic of dubbo3

func (*TripleConn) Invoke

func (t *TripleConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...grpc.CallOption) common.ErrorWithAttachment

Invoke called by unary rpc 's pb.go file in dubbo-go 3.0 design @method is /interfaceKey/functionName e.g. /com.apache.dubbo.sample.basic.IGreeter/BigUnaryTest @arg is request body, must be proto.Message type

func (*TripleConn) NewStream

func (t *TripleConn) NewStream(ctx context.Context, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)

NewStream called when streaming rpc 's pb.go file @method is /interfaceKey/functionName e.g. /com.apache.dubbo.sample.basic.IGreeter/BigStreamTest

type TripleServer

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

TripleServer is the object that can be started and listening remote request

func NewTripleServer

func NewTripleServer(serviceMap *sync.Map, opt *config.Option) *TripleServer

NewTripleServer can create Server with url and some user impl providers stored in @serviceMap @serviceMap should be sync.Map: "interfaceKey" -> Dubbo3GrpcService

func (*TripleServer) RefreshService

func (t *TripleServer) RefreshService()

func (*TripleServer) Start

func (t *TripleServer) Start()

Start can start a triple server

func (*TripleServer) Stop

func (t *TripleServer) Stop()

Stop

Jump to

Keyboard shortcuts

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