Documentation ¶
Index ¶
- Constants
- Variables
- func AppendDetails(details []*anypb.Any, err error) []*anypb.Any
- func IsRecoverable(err error) bool
- func MarshalAny(out *anypb.Any, in proto.Message) error
- func MessageType(msg proto.Message) string
- func ReadFrame(ctx context.Context, r PacketReader, frame *Frame) error
- func UnmarshalAny(out proto.Message, in *anypb.Any) error
- func UnmarshalFromAny(out proto.Message, in *anypb.Any) error
- func UnmarshalFromBytes(out proto.Message, raw []byte) error
- func Watch(ctx context.Context, callback func(), body func() error) error
- func WithContextCall(ctx context.Context, call *Call) context.Context
- func WithContextClient(ctx context.Context, c *Client) context.Context
- func WithContextConn(ctx context.Context, conn *Conn) context.Context
- func WithContextServer(ctx context.Context, s *Server) context.Context
- func WriteBegin(ctx context.Context, w PacketWriter, id ID, method Method) error
- func WriteCancel(ctx context.Context, w PacketWriter, id ID) error
- func WriteEnd(ctx context.Context, w PacketWriter, id ID, status *Status) error
- func WriteFrame(ctx context.Context, w PacketWriter, frame *Frame) error
- func WriteGoAway(ctx context.Context, w PacketWriter) error
- func WriteHalfClose(ctx context.Context, w PacketWriter, id ID) error
- func WriteNoOp(ctx context.Context, w PacketWriter) error
- func WriteRequest(ctx context.Context, w PacketWriter, id ID, payload *anypb.Any) error
- func WriteResponse(ctx context.Context, w PacketWriter, id ID, payload *anypb.Any) error
- func WriteShutdown(ctx context.Context, w PacketWriter) error
- type BaseObserver
- func (BaseObserver) OnAccept(conn *Conn)
- func (BaseObserver) OnAcceptError(err error)
- func (BaseObserver) OnBegin(call *Call)
- func (BaseObserver) OnCancel(call *Call)
- func (BaseObserver) OnClose(conn *Conn, err error)
- func (BaseObserver) OnDial(conn *Conn)
- func (BaseObserver) OnDialError(err error)
- func (BaseObserver) OnEnd(call *Call, status *Status)
- func (BaseObserver) OnGlobalClose()
- func (BaseObserver) OnGlobalShutdown()
- func (BaseObserver) OnGoAway(conn *Conn)
- func (BaseObserver) OnHalfClose(call *Call)
- func (BaseObserver) OnReadError(conn *Conn, err error)
- func (BaseObserver) OnRequest(call *Call, payload *anypb.Any)
- func (BaseObserver) OnResponse(call *Call, payload *anypb.Any)
- func (BaseObserver) OnShutdown(conn *Conn)
- func (BaseObserver) OnWriteError(conn *Conn, err error)
- type BaseStream
- type BiStream
- type Call
- func (call *Call) Cancel() error
- func (call *Call) Close() error
- func (call *Call) CloseSend() error
- func (call *Call) Conn() *Conn
- func (call *Call) Context() context.Context
- func (call *Call) End(status *Status) error
- func (call *Call) ID() ID
- func (call *Call) Method() Method
- func (call *Call) Queue() *Queue
- func (call *Call) Role() Role
- func (call *Call) Send(payload *anypb.Any) error
- func (call *Call) Wait() *Status
- type CallCompleteError
- type CallIdError
- type Client
- type ClientClosingError
- type Conn
- func (conn *Conn) Begin(ctx context.Context, method Method, options ...Option) (*Call, error)
- func (conn *Conn) Client() *Client
- func (conn *Conn) Close() error
- func (conn *Conn) LocalAddr() net.Addr
- func (conn *Conn) PacketConn() PacketConn
- func (conn *Conn) RemoteAddr() net.Addr
- func (conn *Conn) Role() Role
- func (conn *Conn) Server() *Server
- func (conn *Conn) Shutdown(ctx context.Context) error
- type DuplicateCallError
- type EmptyRecvError
- type Frame
- func (*Frame) Descriptor() ([]byte, []int)deprecated
- func (x *Frame) GetCallId() uint32
- func (x *Frame) GetDeadline() *timestamppb.Timestamp
- func (x *Frame) GetMethod() string
- func (x *Frame) GetPayload() *anypb.Any
- func (x *Frame) GetStatus() *Status
- func (x *Frame) GetType() Frame_Type
- func (*Frame) ProtoMessage()
- func (x *Frame) ProtoReflect() protoreflect.Message
- func (x *Frame) Reset()
- func (x *Frame) String() string
- type FrameTypeError
- type Frame_Type
- type FuncObserver
- func (o *FuncObserver) OnAccept(conn *Conn)
- func (o *FuncObserver) OnAcceptError(err error)
- func (o *FuncObserver) OnBegin(call *Call)
- func (o *FuncObserver) OnCancel(call *Call)
- func (o *FuncObserver) OnClose(conn *Conn, err error)
- func (o *FuncObserver) OnDial(conn *Conn)
- func (o *FuncObserver) OnDialError(err error)
- func (o *FuncObserver) OnEnd(call *Call, status *Status)
- func (o *FuncObserver) OnGlobalClose()
- func (o *FuncObserver) OnGlobalShutdown()
- func (o *FuncObserver) OnGoAway(conn *Conn)
- func (o *FuncObserver) OnHalfClose(call *Call)
- func (o *FuncObserver) OnReadError(conn *Conn, err error)
- func (o *FuncObserver) OnRequest(call *Call, payload *anypb.Any)
- func (o *FuncObserver) OnResponse(call *Call, payload *anypb.Any)
- func (o *FuncObserver) OnShutdown(conn *Conn)
- func (o *FuncObserver) OnWriteError(conn *Conn, err error)
- type HalfClosedError
- type Handler
- type HandlerFunc
- type HandlerMux
- func (mux *HandlerMux) Add(h Handler, methods ...Method)
- func (mux *HandlerMux) AddFunc(fn func(*Call) error, methods ...Method)
- func (mux *HandlerMux) Find(method Method, inexact bool) Handler
- func (mux *HandlerMux) Handle(call *Call) error
- func (mux *HandlerMux) Remove(methods ...Method)
- func (mux *HandlerMux) Reset()
- type ID
- type InappropriateError
- type Method
- type NoSuchMethodError
- type Observer
- type Option
- type PacketConn
- type PacketDialer
- type PacketListener
- type PacketReader
- type PacketWriter
- type PanicError
- type ProtocolViolationError
- type Queue
- type RecoverableError
- type RecvStream
- type Role
- type SendStream
- type Server
- type ServerClosingError
- type State
- type Status
- func (status *Status) AsError() error
- func (status *Status) CopyFrom(src *Status)
- func (*Status) Descriptor() ([]byte, []int)deprecated
- func (status *Status) FromError(err error)
- func (x *Status) GetCanRetry() bool
- func (x *Status) GetCode() Status_Code
- func (x *Status) GetDetails() []*anypb.Any
- func (x *Status) GetText() string
- func (status *Status) IsOK() bool
- func (*Status) ProtoMessage()
- func (x *Status) ProtoReflect() protoreflect.Message
- func (x *Status) Reset()
- func (x *Status) String() string
- type StatusError
- type Status_Code
- func (Status_Code) Descriptor() protoreflect.EnumDescriptor
- func (x Status_Code) Enum() *Status_Code
- func (Status_Code) EnumDescriptor() ([]byte, []int)deprecated
- func (x Status_Code) Number() protoreflect.EnumNumber
- func (x Status_Code) String() string
- func (Status_Code) Type() protoreflect.EnumType
- type SumRequest
- type SumResponse
- type TypeError
- type UnixPacketConn
- func (pc *UnixPacketConn) Close() error
- func (pc *UnixPacketConn) LocalAddr() net.Addr
- func (pc *UnixPacketConn) ReadPacket(ctx context.Context) (packet []byte, dispose func(), err error)
- func (pc *UnixPacketConn) RemoteAddr() net.Addr
- func (pc *UnixPacketConn) WritePacket(ctx context.Context, packet []byte) error
- type UnixPacketDialer
- type UnixPacketListener
- type UnmarshalError
- type UnrecoverableError
Constants ¶
View Source
const DefaultUnixMaxPacketSize = (1 << 24)
Variables ¶
View Source
var ( Frame_Type_name = map[int32]string{ 0: "NO_OP", 1: "SHUTDOWN", 2: "GO_AWAY", 3: "BEGIN", 4: "REQUEST", 5: "RESPONSE", 6: "HALF_CLOSE", 7: "CANCEL", 8: "END", } Frame_Type_value = map[string]int32{ "NO_OP": 0, "SHUTDOWN": 1, "GO_AWAY": 2, "BEGIN": 3, "REQUEST": 4, "RESPONSE": 5, "HALF_CLOSE": 6, "CANCEL": 7, "END": 8, } )
Enum value maps for Frame_Type.
View Source
var ( Status_Code_name = map[int32]string{ 0: "OK", 1: "CANCELLED", 2: "UNKNOWN", 3: "INVALID_ARGUMENT", 4: "DEADLINE_EXCEEDED", 5: "NOT_FOUND", 6: "ALREADY_EXISTS", 7: "PERMISSION_DENIED", 8: "RESOURCE_EXHAUSTED", 9: "FAILED_PRECONDITION", 10: "ABORTED", 11: "OUT_OF_RANGE", 12: "UNIMPLEMENTED", 13: "INTERNAL", 14: "UNAVAILABLE", 15: "DATA_LOSS", 16: "UNAUTHENTICATED", } Status_Code_value = map[string]int32{ "OK": 0, "CANCELLED": 1, "UNKNOWN": 2, "INVALID_ARGUMENT": 3, "DEADLINE_EXCEEDED": 4, "NOT_FOUND": 5, "ALREADY_EXISTS": 6, "PERMISSION_DENIED": 7, "RESOURCE_EXHAUSTED": 8, "FAILED_PRECONDITION": 9, "ABORTED": 10, "OUT_OF_RANGE": 11, "UNIMPLEMENTED": 12, "INTERNAL": 13, "UNAVAILABLE": 14, "DATA_LOSS": 15, "UNAUTHENTICATED": 16, } )
Enum value maps for Status_Code.
View Source
var ErrCallComplete error = CallCompleteError{}
View Source
var ErrClientClosed = fs.ErrClosed
View Source
var ErrClientClosing error = ClientClosingError{}
View Source
var ErrClosed = fs.ErrClosed
View Source
var ErrConnClosed = fs.ErrClosed
View Source
var ErrEmptyRecv error = EmptyRecvError{}
View Source
var ErrHalfClosed error = HalfClosedError{}
View Source
var ErrServerClosed = fs.ErrClosed
View Source
var ErrServerClosing error = ServerClosingError{}
View Source
var File_vsrpc_frame_proto protoreflect.FileDescriptor
View Source
var File_vsrpc_status_proto protoreflect.FileDescriptor
View Source
var File_vsrpc_vsrpc_test_proto protoreflect.FileDescriptor
Functions ¶
func IsRecoverable ¶
func MessageType ¶
func WriteBegin ¶
func WriteCancel ¶
func WriteCancel(ctx context.Context, w PacketWriter, id ID) error
func WriteFrame ¶
func WriteFrame(ctx context.Context, w PacketWriter, frame *Frame) error
func WriteGoAway ¶
func WriteGoAway(ctx context.Context, w PacketWriter) error
func WriteHalfClose ¶
func WriteHalfClose(ctx context.Context, w PacketWriter, id ID) error
func WriteRequest ¶
func WriteResponse ¶
func WriteShutdown ¶
func WriteShutdown(ctx context.Context, w PacketWriter) error
Types ¶
type BaseObserver ¶
type BaseObserver struct{}
func (BaseObserver) OnAccept ¶
func (BaseObserver) OnAccept(conn *Conn)
func (BaseObserver) OnAcceptError ¶
func (BaseObserver) OnAcceptError(err error)
func (BaseObserver) OnBegin ¶
func (BaseObserver) OnBegin(call *Call)
func (BaseObserver) OnCancel ¶
func (BaseObserver) OnCancel(call *Call)
func (BaseObserver) OnClose ¶
func (BaseObserver) OnClose(conn *Conn, err error)
func (BaseObserver) OnDial ¶
func (BaseObserver) OnDial(conn *Conn)
func (BaseObserver) OnDialError ¶
func (BaseObserver) OnDialError(err error)
func (BaseObserver) OnEnd ¶
func (BaseObserver) OnEnd(call *Call, status *Status)
func (BaseObserver) OnGlobalClose ¶
func (BaseObserver) OnGlobalClose()
func (BaseObserver) OnGlobalShutdown ¶
func (BaseObserver) OnGlobalShutdown()
func (BaseObserver) OnGoAway ¶
func (BaseObserver) OnGoAway(conn *Conn)
func (BaseObserver) OnHalfClose ¶
func (BaseObserver) OnHalfClose(call *Call)
func (BaseObserver) OnReadError ¶
func (BaseObserver) OnReadError(conn *Conn, err error)
func (BaseObserver) OnResponse ¶
func (BaseObserver) OnResponse(call *Call, payload *anypb.Any)
func (BaseObserver) OnShutdown ¶
func (BaseObserver) OnShutdown(conn *Conn)
func (BaseObserver) OnWriteError ¶
func (BaseObserver) OnWriteError(conn *Conn, err error)
type BaseStream ¶
type BiStream ¶
type BiStream[T proto.Message, U proto.Message] interface { BaseStream SendStream[T] RecvStream[U] }
type CallCompleteError ¶
type CallCompleteError struct{}
func (CallCompleteError) Error ¶
func (err CallCompleteError) Error() string
type CallIdError ¶
type CallIdError struct { Type Frame_Type ID ID }
func (CallIdError) Error ¶
func (err CallIdError) Error() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func ContextClient ¶
func NewClient ¶
func NewClient(pd PacketDialer, options ...Option) *Client
func (*Client) DialExisting ¶
func (c *Client) DialExisting(pc PacketConn, options ...Option) (*Conn, error)
func (*Client) Dialer ¶
func (c *Client) Dialer() PacketDialer
type ClientClosingError ¶
type ClientClosingError struct{}
func (ClientClosingError) Error ¶
func (err ClientClosingError) Error() string
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func ContextConn ¶
func (*Conn) PacketConn ¶
func (conn *Conn) PacketConn() PacketConn
func (*Conn) RemoteAddr ¶
type DuplicateCallError ¶
func (DuplicateCallError) Error ¶
func (err DuplicateCallError) Error() string
type EmptyRecvError ¶
type EmptyRecvError struct{}
func (EmptyRecvError) Error ¶
func (EmptyRecvError) Error() string
type Frame ¶
type Frame struct { Type Frame_Type `protobuf:"varint,1,opt,name=type,proto3,enum=vsrpc.Frame_Type" json:"type,omitempty"` CallId uint32 `protobuf:"varint,2,opt,name=call_id,json=callId,proto3" json:"call_id,omitempty"` Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` Deadline *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=deadline,proto3" json:"deadline,omitempty"` Payload *anypb.Any `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` Status *Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*Frame) Descriptor
deprecated
func (*Frame) GetDeadline ¶
func (x *Frame) GetDeadline() *timestamppb.Timestamp
func (*Frame) GetPayload ¶
func (*Frame) GetType ¶
func (x *Frame) GetType() Frame_Type
func (*Frame) ProtoMessage ¶
func (*Frame) ProtoMessage()
func (*Frame) ProtoReflect ¶
func (x *Frame) ProtoReflect() protoreflect.Message
type FrameTypeError ¶
type FrameTypeError struct {
Type Frame_Type
}
func (FrameTypeError) Error ¶
func (err FrameTypeError) Error() string
type Frame_Type ¶
type Frame_Type int32
const ( // NO_OP denotes a frame that does nothing. // // A NO_OP frame is *not* a ping and does *not* solicit a response. Both // clients and servers should ignore any NO_OP frames they receive, and // neither clients nor servers should send NO_OP frames under normal // circumstances. // // Direction: any // Required fields: type // Optional fields: NONE Frame_NO_OP Frame_Type = 0 // SHUTDOWN tells the server that no more BEGIN frames will be sent. // // Direction: client to server // Required fields: type // Optional fields: NONE Frame_SHUTDOWN Frame_Type = 1 // GO_AWAY tells the client that future BEGIN frames will not be honored, // because the server is shutting down the connection. // // The server may start aborting in-progress RPC calls if they do not // complete quickly enough, or it may close the connection without warning, // with or without sending a GO_AWAY frame. The client must treat // abandoned RPC calls as having failed with status code ABORTED. // // Direction: server to client // Required fields: type // Optional fields: NONE Frame_GO_AWAY Frame_Type = 2 // BEGIN creates a new RPC call. // // Direction: client to server // Required fields: type, call_id, method // Optional fields: deadline Frame_BEGIN Frame_Type = 3 // REQUEST sends a request body for an RPC call. // // Direction: client to server // Required fields: type, call_id, payload // Optional fields: NONE Frame_REQUEST Frame_Type = 4 // RESPONSE sends a response body for an RPC call. // // It is valid for the server to send RESPONSE frames before the client has // sent HALF_CLOSE; this is how bidirectional streaming works. // // Direction: server to client // Required fields: type, call_id, payload // Optional fields: NONE Frame_RESPONSE Frame_Type = 5 // HALF_CLOSE tells the server that no more REQUEST frames will be sent for // this RPC call. // // Direction: client to server // Required fields: type, call_id // Optional fields: NONE Frame_HALF_CLOSE Frame_Type = 6 // CANCEL asks the server to cancel the in-progress RPC call. // // The RPC call remains outstanding until the server sends a END frame. // Status code CANCELLED indicates that the cancellation was accepted. // // Direction: client to server // Required fields: type, call_id // Optional fields: NONE Frame_CANCEL Frame_Type = 7 // END reports the final status of the RPC call. // // If the client continues to send frames relating to this call, the server // must ignore them; they are NOT a protocol violation. // // Direction: server to client // Required fields: type, call_id, status // Optional fields: NONE Frame_END Frame_Type = 8 )
func (Frame_Type) Descriptor ¶
func (Frame_Type) Descriptor() protoreflect.EnumDescriptor
func (Frame_Type) Enum ¶
func (x Frame_Type) Enum() *Frame_Type
func (Frame_Type) EnumDescriptor
deprecated
func (Frame_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Frame_Type.Descriptor instead.
func (Frame_Type) Number ¶
func (x Frame_Type) Number() protoreflect.EnumNumber
func (Frame_Type) String ¶
func (x Frame_Type) String() string
func (Frame_Type) Type ¶
func (Frame_Type) Type() protoreflect.EnumType
type FuncObserver ¶
type FuncObserver struct { Accept func(conn *Conn) AcceptError func(err error) Dial func(conn *Conn) DialError func(err error) GlobalShutdown func() GlobalClose func() Begin func(call *Call) Request func(call *Call, payload *anypb.Any) Response func(call *Call, payload *anypb.Any) HalfClose func(call *Call) Cancel func(call *Call) End func(call *Call, status *Status) Shutdown func(conn *Conn) GoAway func(conn *Conn) ReadError func(conn *Conn, err error) WriteError func(conn *Conn, err error) Close func(conn *Conn, err error) }
func (*FuncObserver) OnAccept ¶
func (o *FuncObserver) OnAccept(conn *Conn)
func (*FuncObserver) OnAcceptError ¶
func (o *FuncObserver) OnAcceptError(err error)
func (*FuncObserver) OnBegin ¶
func (o *FuncObserver) OnBegin(call *Call)
func (*FuncObserver) OnCancel ¶
func (o *FuncObserver) OnCancel(call *Call)
func (*FuncObserver) OnClose ¶
func (o *FuncObserver) OnClose(conn *Conn, err error)
func (*FuncObserver) OnDial ¶
func (o *FuncObserver) OnDial(conn *Conn)
func (*FuncObserver) OnDialError ¶
func (o *FuncObserver) OnDialError(err error)
func (*FuncObserver) OnEnd ¶
func (o *FuncObserver) OnEnd(call *Call, status *Status)
func (*FuncObserver) OnGlobalClose ¶
func (o *FuncObserver) OnGlobalClose()
func (*FuncObserver) OnGlobalShutdown ¶
func (o *FuncObserver) OnGlobalShutdown()
func (*FuncObserver) OnGoAway ¶
func (o *FuncObserver) OnGoAway(conn *Conn)
func (*FuncObserver) OnHalfClose ¶
func (o *FuncObserver) OnHalfClose(call *Call)
func (*FuncObserver) OnReadError ¶
func (o *FuncObserver) OnReadError(conn *Conn, err error)
func (*FuncObserver) OnResponse ¶
func (o *FuncObserver) OnResponse(call *Call, payload *anypb.Any)
func (*FuncObserver) OnShutdown ¶
func (o *FuncObserver) OnShutdown(conn *Conn)
func (*FuncObserver) OnWriteError ¶
func (o *FuncObserver) OnWriteError(conn *Conn, err error)
type HalfClosedError ¶
type HalfClosedError struct{}
func (HalfClosedError) Error ¶
func (err HalfClosedError) Error() string
type HandlerFunc ¶
func (HandlerFunc) Handle ¶
func (fn HandlerFunc) Handle(call *Call) error
type HandlerMux ¶
type HandlerMux struct {
// contains filtered or unexported fields
}
func (*HandlerMux) Add ¶
func (mux *HandlerMux) Add(h Handler, methods ...Method)
func (*HandlerMux) AddFunc ¶
func (mux *HandlerMux) AddFunc(fn func(*Call) error, methods ...Method)
func (*HandlerMux) Handle ¶
func (mux *HandlerMux) Handle(call *Call) error
func (*HandlerMux) Remove ¶
func (mux *HandlerMux) Remove(methods ...Method)
func (*HandlerMux) Reset ¶
func (mux *HandlerMux) Reset()
type InappropriateError ¶
func (InappropriateError) Error ¶
func (err InappropriateError) Error() string
type NoSuchMethodError ¶
type NoSuchMethodError struct {
Method Method
}
func (NoSuchMethodError) As ¶
func (err NoSuchMethodError) As(out any) bool
func (NoSuchMethodError) Error ¶
func (err NoSuchMethodError) Error() string
type Observer ¶
type Observer interface { OnAccept(conn *Conn) OnAcceptError(err error) OnDial(conn *Conn) OnDialError(err error) OnGlobalShutdown() OnGlobalClose() OnBegin(call *Call) OnRequest(call *Call, payload *anypb.Any) OnResponse(call *Call, payload *anypb.Any) OnHalfClose(call *Call) OnCancel(call *Call) OnEnd(call *Call, status *Status) OnShutdown(conn *Conn) OnGoAway(conn *Conn) OnReadError(conn *Conn, err error) OnWriteError(conn *Conn, err error) OnClose(conn *Conn, err error) }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func ConcatOptions ¶
func WithObserver ¶
type PacketConn ¶
type PacketConn interface { io.Closer PacketReader PacketWriter LocalAddr() net.Addr RemoteAddr() net.Addr }
type PacketDialer ¶
type PacketDialer interface { DialPacket(ctx context.Context, addr net.Addr) (PacketConn, error) ListenPacket(ctx context.Context, addr net.Addr) (PacketListener, error) }
var DefaultPacketDialer PacketDialer
type PacketListener ¶
type PacketReader ¶
type PacketWriter ¶
type PanicError ¶
type PanicError struct {
Err error
}
func (PanicError) Error ¶
func (err PanicError) Error() string
func (PanicError) Unwrap ¶
func (err PanicError) Unwrap() error
type ProtocolViolationError ¶
type ProtocolViolationError struct {
Err error
}
func (ProtocolViolationError) Error ¶
func (err ProtocolViolationError) Error() string
func (ProtocolViolationError) IsRecoverable ¶
func (err ProtocolViolationError) IsRecoverable() bool
func (ProtocolViolationError) Unwrap ¶
func (err ProtocolViolationError) Unwrap() error
type RecoverableError ¶
type RecoverableError struct {
Err error
}
func (RecoverableError) Error ¶
func (err RecoverableError) Error() string
func (RecoverableError) IsRecoverable ¶
func (err RecoverableError) IsRecoverable() bool
func (RecoverableError) Unwrap ¶
func (err RecoverableError) Unwrap() error
type RecvStream ¶
type RecvStream[T proto.Message] interface { BaseStream Recv(blocking bool, out T) (ok bool, done bool, err error) }
func NewRecvStream ¶
func NewRecvStream[T proto.Message](call *Call) RecvStream[T]
type SendStream ¶
type SendStream[T proto.Message] interface { BaseStream Send(in T) error CloseSend() error }
func NewSendStream ¶
func NewSendStream[T proto.Message](call *Call) SendStream[T]
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func ContextServer ¶
func (*Server) Listener ¶
func (s *Server) Listener() PacketListener
type ServerClosingError ¶
type ServerClosingError struct{}
func (ServerClosingError) Error ¶
func (err ServerClosingError) Error() string
type Status ¶
type Status struct { Code Status_Code `protobuf:"varint,1,opt,name=code,proto3,enum=vsrpc.Status_Code" json:"code,omitempty"` Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` CanRetry bool `protobuf:"varint,4,opt,name=can_retry,json=canRetry,proto3" json:"can_retry,omitempty"` // contains filtered or unexported fields }
func StatusFromError ¶
func (*Status) Descriptor
deprecated
func (*Status) GetCanRetry ¶
func (*Status) GetCode ¶
func (x *Status) GetCode() Status_Code
func (*Status) GetDetails ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type StatusError ¶
type StatusError struct {
Status *Status
}
func (StatusError) Error ¶
func (err StatusError) Error() string
type Status_Code ¶
type Status_Code int32
const ( Status_OK Status_Code = 0 Status_CANCELLED Status_Code = 1 Status_UNKNOWN Status_Code = 2 Status_INVALID_ARGUMENT Status_Code = 3 Status_DEADLINE_EXCEEDED Status_Code = 4 Status_NOT_FOUND Status_Code = 5 Status_ALREADY_EXISTS Status_Code = 6 Status_PERMISSION_DENIED Status_Code = 7 Status_RESOURCE_EXHAUSTED Status_Code = 8 Status_FAILED_PRECONDITION Status_Code = 9 Status_ABORTED Status_Code = 10 Status_OUT_OF_RANGE Status_Code = 11 Status_UNIMPLEMENTED Status_Code = 12 Status_INTERNAL Status_Code = 13 Status_UNAVAILABLE Status_Code = 14 Status_DATA_LOSS Status_Code = 15 Status_UNAUTHENTICATED Status_Code = 16 )
func (Status_Code) Descriptor ¶
func (Status_Code) Descriptor() protoreflect.EnumDescriptor
func (Status_Code) Enum ¶
func (x Status_Code) Enum() *Status_Code
func (Status_Code) EnumDescriptor
deprecated
func (Status_Code) EnumDescriptor() ([]byte, []int)
Deprecated: Use Status_Code.Descriptor instead.
func (Status_Code) Number ¶
func (x Status_Code) Number() protoreflect.EnumNumber
func (Status_Code) String ¶
func (x Status_Code) String() string
func (Status_Code) Type ¶
func (Status_Code) Type() protoreflect.EnumType
type SumRequest ¶
type SumRequest struct { Input []int32 `protobuf:"varint,1,rep,packed,name=input,proto3" json:"input,omitempty"` // contains filtered or unexported fields }
func (*SumRequest) Descriptor
deprecated
func (*SumRequest) Descriptor() ([]byte, []int)
Deprecated: Use SumRequest.ProtoReflect.Descriptor instead.
func (*SumRequest) GetInput ¶
func (x *SumRequest) GetInput() []int32
func (*SumRequest) ProtoMessage ¶
func (*SumRequest) ProtoMessage()
func (*SumRequest) ProtoReflect ¶
func (x *SumRequest) ProtoReflect() protoreflect.Message
func (*SumRequest) Reset ¶
func (x *SumRequest) Reset()
func (*SumRequest) String ¶
func (x *SumRequest) String() string
type SumResponse ¶
type SumResponse struct { Output int32 `protobuf:"varint,1,opt,name=output,proto3" json:"output,omitempty"` // contains filtered or unexported fields }
func (*SumResponse) Descriptor
deprecated
func (*SumResponse) Descriptor() ([]byte, []int)
Deprecated: Use SumResponse.ProtoReflect.Descriptor instead.
func (*SumResponse) GetOutput ¶
func (x *SumResponse) GetOutput() int32
func (*SumResponse) ProtoMessage ¶
func (*SumResponse) ProtoMessage()
func (*SumResponse) ProtoReflect ¶
func (x *SumResponse) ProtoReflect() protoreflect.Message
func (*SumResponse) Reset ¶
func (x *SumResponse) Reset()
func (*SumResponse) String ¶
func (x *SumResponse) String() string
type TypeError ¶
type TypeError struct { Actual protoreflect.FullName Expect protoreflect.FullName }
type UnixPacketConn ¶
type UnixPacketConn struct { Conn net.Conn Now func() time.Time MaxPacketSize uint ReadTimeout time.Duration WriteTimeout time.Duration ReadTimeoutEnabled bool WriteTimeoutEnabled bool }
func (*UnixPacketConn) Close ¶
func (pc *UnixPacketConn) Close() error
func (*UnixPacketConn) LocalAddr ¶
func (pc *UnixPacketConn) LocalAddr() net.Addr
func (*UnixPacketConn) ReadPacket ¶
func (pc *UnixPacketConn) ReadPacket(ctx context.Context) (packet []byte, dispose func(), err error)
func (*UnixPacketConn) RemoteAddr ¶
func (pc *UnixPacketConn) RemoteAddr() net.Addr
func (*UnixPacketConn) WritePacket ¶
func (pc *UnixPacketConn) WritePacket(ctx context.Context, packet []byte) error
type UnixPacketDialer ¶
type UnixPacketDialer struct { Dialer *net.Dialer ListenConfig *net.ListenConfig Now func() time.Time MaxPacketSize uint AcceptTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration AcceptTimeoutEnabled bool ReadTimeoutEnabled bool WriteTimeoutEnabled bool UnlinkOnClose bool }
func (*UnixPacketDialer) DialPacket ¶
func (pd *UnixPacketDialer) DialPacket(ctx context.Context, addr net.Addr) (PacketConn, error)
func (*UnixPacketDialer) ListenPacket ¶
func (pd *UnixPacketDialer) ListenPacket(ctx context.Context, addr net.Addr) (PacketListener, error)
type UnixPacketListener ¶
type UnixPacketListener struct { Listener net.Listener Now func() time.Time MaxPacketSize uint AcceptTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration AcceptTimeoutEnabled bool ReadTimeoutEnabled bool WriteTimeoutEnabled bool }
func (*UnixPacketListener) AcceptPacket ¶
func (pl *UnixPacketListener) AcceptPacket(ctx context.Context) (pc PacketConn, err error)
func (*UnixPacketListener) Addr ¶
func (pl *UnixPacketListener) Addr() net.Addr
func (*UnixPacketListener) Close ¶
func (pl *UnixPacketListener) Close() error
type UnmarshalError ¶
func (UnmarshalError) As ¶
func (err UnmarshalError) As(out any) bool
func (UnmarshalError) Error ¶
func (err UnmarshalError) Error() string
func (UnmarshalError) Unwrap ¶
func (err UnmarshalError) Unwrap() error
type UnrecoverableError ¶
type UnrecoverableError struct {
Err error
}
func (UnrecoverableError) Error ¶
func (err UnrecoverableError) Error() string
func (UnrecoverableError) IsRecoverable ¶
func (err UnrecoverableError) IsRecoverable() bool
func (UnrecoverableError) Unwrap ¶
func (err UnrecoverableError) Unwrap() error
Source Files ¶
- call.go
- client.go
- conn.go
- context.go
- doc.go
- enums.go
- err_appenddetails.go
- err_as.go
- err_callid.go
- err_close.go
- err_dupcall.go
- err_frametype.go
- err_inappropriate.go
- err_nosuchmethod.go
- err_panic.go
- err_protoviolation.go
- err_recoverable.go
- err_recv.go
- err_status.go
- err_type.go
- err_unmarshal.go
- err_unwrap.go
- frame.go
- frame.pb.go
- handler.go
- lock.go
- marshal.go
- observer.go
- option.go
- packetconn.go
- packetconn_unix.go
- queue.go
- server.go
- status.go
- status.pb.go
- stream.go
- util.go
- util_go120.go
- vsrpc_test.pb.go
- watch.go
Click to show internal directories.
Click to hide internal directories.