Documentation ¶
Index ¶
- Variables
- type CallOption
- type CallOptions
- type Client
- type ErrPayload
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)deprecated
- func (x *Metadata) GetAddress() string
- func (x *Metadata) GetHeader() map[string]string
- func (x *Metadata) GetMethod() string
- func (x *Metadata) GetRequestId() string
- func (x *Metadata) GetService() string
- func (x *Metadata) GetTrace() string
- func (x *Metadata) GetVersion() string
- func (*Metadata) ProtoMessage()
- func (x *Metadata) ProtoReflect() protoreflect.Message
- func (x *Metadata) Reset()
- func (x *Metadata) String() string
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetContentType() string
- func (x *Request) GetHeaders() map[string]string
- func (x *Request) GetMethod() string
- func (x *Request) GetRequestId() string
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetCode() int32
- func (x *Response) GetDuration() int32
- func (x *Response) GetHeaders() map[string]string
- func (x *Response) GetMsg() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type Server
- type StreamHandler
- type UnaryHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSendClosed = fmt.Errorf("send closed")
View Source
var File_entry_rsocketEntry_sockets_metadata_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CallOption ¶
type CallOption interface { grpc.CallOption Lava() }
type CallOptions ¶
type CallOptions struct { grpc.EmptyCallOption // Headers is a slice of metadata pointers which should all be set when // response header metadata is received. Headers []*metadata.MD // Trailers is a slice of metadata pointers which should all be set when // response trailer metadata is received. Trailers []*metadata.MD // Peer is a slice of peer pointers which should all be set when the // remote peer is known. Peer []*peer.Peer // Creds are per-RPC credentials to use for a call. Creds credentials.PerRPCCredentials // MaxRecv is the maximum number of bytes to receive for a single message // in a call. MaxRecv int // MaxSend is the maximum number of bytes to send for a single message in // a call. MaxSend int ContentSubtype string CompressorType string Codec encoding.Codec }
CallOptions represents the state of in-effect grpc.CallOptions.
func GetCallOptions ¶
func GetCallOptions(opts ...grpc.CallOption) *CallOptions
GetCallOptions converts the given slice of grpc.CallOptions into a CallOptions struct.
func (*CallOptions) Lava ¶
func (co *CallOptions) Lava()
func (*CallOptions) SetHeaders ¶
func (co *CallOptions) SetHeaders(md metadata.MD)
SetHeaders sets all accumulated header addresses to the given metadata. This satisfies grpc.Header call options.
func (*CallOptions) SetPeer ¶
func (co *CallOptions) SetPeer(p *peer.Peer)
SetPeer sets all accumulated peer addresses to the given peer. This satisfies grpc.Peer call options.
func (*CallOptions) SetTrailers ¶
func (co *CallOptions) SetTrailers(md metadata.MD)
SetTrailers sets all accumulated trailer addresses to the given metadata. This satisfies grpc.Trailer call options.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Invoke ¶
func (t *Client) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
Invoke 请求响应模型实现
func (*Client) NewStream ¶
func (t *Client) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
NewStream 单项流和双向流实现
type ErrPayload ¶
func NewErrPayload ¶
func NewErrPayload(data payload.Payload) *ErrPayload
type Metadata ¶
type Metadata struct { Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` Trace string `protobuf:"bytes,4,opt,name=trace,proto3" json:"trace,omitempty"` Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` RequestId string `protobuf:"bytes,6,opt,name=requestId,proto3" json:"requestId,omitempty"` Header map[string]string `` /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Metadata) Descriptor
deprecated
func (*Metadata) GetAddress ¶
func (*Metadata) GetRequestId ¶
func (*Metadata) GetService ¶
func (*Metadata) GetVersion ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` ContentType string `protobuf:"bytes,2,opt,name=contentType,proto3" json:"contentType,omitempty"` RequestId string `protobuf:"bytes,3,opt,name=requestId,proto3" json:"requestId,omitempty"` Headers map[string]string `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetContentType ¶
func (*Request) GetHeaders ¶
func (*Request) GetRequestId ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // 持续时间(ms) Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` Headers map[string]string `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetDuration ¶
func (*Response) GetHeaders ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type StreamHandler ¶
type StreamHandler = grpc.StreamHandler
type UnaryHandler ¶
Click to show internal directories.
Click to hide internal directories.