muxer

package
v0.12.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMuxerTest        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMuxerTest          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMuxerTest = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NetListener

func NetListener(l manet.Listener) net.Listener

NetListener turns this Listener into a net.Listener.

  • Connections returned from Accept implement multiaddr-net Conn.
  • Calling WrapNetListener on the net.Listener returned by this function will return the original (underlying) multiaddr-net Listener.

func RegisterGreeterServer

func RegisterGreeterServer(s *grpc.Server, srv GreeterServer)

Types

type GreeterClient

type GreeterClient interface {
	Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}

GreeterClient is the client API for Greeter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewGreeterClient

func NewGreeterClient(cc *grpc.ClientConn) GreeterClient

type GreeterServer

type GreeterServer interface {
	Hello(context.Context, *HelloRequest) (*HelloResponse, error)
}

GreeterServer is the server API for Greeter service.

type HelloRequest

type HelloRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request message example

func (*HelloRequest) Descriptor

func (*HelloRequest) Descriptor() ([]byte, []int)

func (*HelloRequest) GetName

func (m *HelloRequest) GetName() string

func (*HelloRequest) Marshal

func (m *HelloRequest) Marshal() (dAtA []byte, err error)

func (*HelloRequest) MarshalTo

func (m *HelloRequest) MarshalTo(dAtA []byte) (int, error)

func (*HelloRequest) MarshalToSizedBuffer

func (m *HelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) Reset

func (m *HelloRequest) Reset()

func (*HelloRequest) Size

func (m *HelloRequest) Size() (n int)

func (*HelloRequest) String

func (m *HelloRequest) String() string

func (*HelloRequest) Unmarshal

func (m *HelloRequest) Unmarshal(dAtA []byte) error

func (*HelloRequest) XXX_DiscardUnknown

func (m *HelloRequest) XXX_DiscardUnknown()

func (*HelloRequest) XXX_Marshal

func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloRequest) XXX_Merge

func (m *HelloRequest) XXX_Merge(src proto.Message)

func (*HelloRequest) XXX_Size

func (m *HelloRequest) XXX_Size() int

func (*HelloRequest) XXX_Unmarshal

func (m *HelloRequest) XXX_Unmarshal(b []byte) error

type HelloResponse

type HelloResponse struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HelloResponse) Descriptor

func (*HelloResponse) Descriptor() ([]byte, []int)

func (*HelloResponse) GetMessage

func (m *HelloResponse) GetMessage() string

func (*HelloResponse) Marshal

func (m *HelloResponse) Marshal() (dAtA []byte, err error)

func (*HelloResponse) MarshalTo

func (m *HelloResponse) MarshalTo(dAtA []byte) (int, error)

func (*HelloResponse) MarshalToSizedBuffer

func (m *HelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HelloResponse) ProtoMessage

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) Reset

func (m *HelloResponse) Reset()

func (*HelloResponse) Size

func (m *HelloResponse) Size() (n int)

func (*HelloResponse) String

func (m *HelloResponse) String() string

func (*HelloResponse) Unmarshal

func (m *HelloResponse) Unmarshal(dAtA []byte) error

func (*HelloResponse) XXX_DiscardUnknown

func (m *HelloResponse) XXX_DiscardUnknown()

func (*HelloResponse) XXX_Marshal

func (m *HelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloResponse) XXX_Merge

func (m *HelloResponse) XXX_Merge(src proto.Message)

func (*HelloResponse) XXX_Size

func (m *HelloResponse) XXX_Size() int

func (*HelloResponse) XXX_Unmarshal

func (m *HelloResponse) XXX_Unmarshal(b []byte) error

type Mux

type Mux interface {
	Start(ctx context.Context)
	Stop()
}

Mux is an interface of network connections muxer.

func New

func New(p Params) Mux

New constructs network connections muxer and returns Mux interface.

type Params

type Params struct {
	Logger      *zap.Logger
	API         *fasthttp.Server
	Address     multiaddr.Multiaddr
	ShutdownTTL time.Duration
	P2P         *grpc.Server
}

StoreParams groups the parameters of network connections muxer constructor.

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer can be embedded to have forward compatible implementations.

func (*UnimplementedGreeterServer) Hello

Jump to

Keyboard shortcuts

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