Versions in this module Expand all Collapse all v0 v0.1.0 Apr 30, 2023 Changes in this version + const DefaultUnixMaxPacketSize + var ErrCallComplete error = CallCompleteError + var ErrClientClosed = fs.ErrClosed + var ErrClientClosing error = ClientClosingError + var ErrClosed = fs.ErrClosed + var ErrConnClosed = fs.ErrClosed + var ErrEmptyRecv error = EmptyRecvError + var ErrHalfClosed error = HalfClosedError + var ErrServerClosed = fs.ErrClosed + var ErrServerClosing error = ServerClosingError + var File_vsrpc_frame_proto protoreflect.FileDescriptor + var File_vsrpc_status_proto protoreflect.FileDescriptor + var File_vsrpc_vsrpc_test_proto protoreflect.FileDescriptor + var Frame_Type_name = map[int32]string + var Frame_Type_value = map[string]int32 + var Status_Code_name = map[int32]string + var Status_Code_value = map[string]int32 + 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 struct + 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 interface + Call func() *Call + Cancel func() error + Conn func() *Conn + Context func() context.Context + ID func() ID + Method func() Method + type BiStream interface + func NewBiStream(call *Call) BiStream[T, U] + type Call struct + func ContextCall(ctx context.Context) *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 struct + func (err CallCompleteError) Error() string + type CallIdError struct + ID ID + Type Frame_Type + func (err CallIdError) Error() string + type Client struct + func ContextClient(ctx context.Context) *Client + func NewClient(pd PacketDialer, options ...Option) *Client + func (c *Client) Close() error + func (c *Client) Dial(ctx context.Context, addr net.Addr, options ...Option) (*Conn, error) + func (c *Client) DialExisting(pc PacketConn, options ...Option) (*Conn, error) + func (c *Client) Dialer() PacketDialer + func (c *Client) Shutdown(ctx context.Context) error + type ClientClosingError struct + func (err ClientClosingError) Error() string + type Conn struct + func ContextConn(ctx context.Context) *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 struct + ID ID + New Method + Old Method + func (err DuplicateCallError) Error() string + type EmptyRecvError struct + func (EmptyRecvError) Error() string + type Frame struct + CallId uint32 + Deadline *timestamppb.Timestamp + Method string + Payload *anypb.Any + Status *Status + Type Frame_Type + func (*Frame) Descriptor() ([]byte, []int) + func (*Frame) ProtoMessage() + 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 (x *Frame) ProtoReflect() protoreflect.Message + func (x *Frame) Reset() + func (x *Frame) String() string + type FrameTypeError struct + Type Frame_Type + func (err FrameTypeError) Error() string + type Frame_Type int32 + const Frame_BEGIN + const Frame_CANCEL + const Frame_END + const Frame_GO_AWAY + const Frame_HALF_CLOSE + const Frame_NO_OP + const Frame_REQUEST + const Frame_RESPONSE + const Frame_SHUTDOWN + func (Frame_Type) Descriptor() protoreflect.EnumDescriptor + func (Frame_Type) EnumDescriptor() ([]byte, []int) + func (Frame_Type) Type() protoreflect.EnumType + func (x Frame_Type) Enum() *Frame_Type + func (x Frame_Type) Number() protoreflect.EnumNumber + func (x Frame_Type) String() string + type FuncObserver struct + Accept func(conn *Conn) + AcceptError func(err error) + Begin func(call *Call) + Cancel func(call *Call) + Close func(conn *Conn, err error) + Dial func(conn *Conn) + DialError func(err error) + End func(call *Call, status *Status) + GlobalClose func() + GlobalShutdown func() + GoAway func(conn *Conn) + HalfClose func(call *Call) + ReadError func(conn *Conn, err error) + Request func(call *Call, payload *anypb.Any) + Response func(call *Call, payload *anypb.Any) + Shutdown func(conn *Conn) + WriteError func(conn *Conn, err error) + 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 struct + func (err HalfClosedError) Error() string + type Handler interface + Handle func(*Call) error + type HandlerFunc func(*Call) error + func (fn HandlerFunc) Handle(call *Call) error + type HandlerMux struct + 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 uint32 + type InappropriateError struct + Op string + Role Role + func (err InappropriateError) Error() string + type Method string + type NoSuchMethodError struct + Method Method + func (err NoSuchMethodError) As(out any) bool + func (err NoSuchMethodError) Error() string + type Observer interface + OnAccept func(conn *Conn) + OnAcceptError func(err error) + OnBegin func(call *Call) + OnCancel func(call *Call) + OnClose func(conn *Conn, err error) + OnDial func(conn *Conn) + OnDialError func(err error) + OnEnd func(call *Call, status *Status) + OnGlobalClose func() + OnGlobalShutdown func() + OnGoAway func(conn *Conn) + OnHalfClose func(call *Call) + OnReadError func(conn *Conn, err error) + OnRequest func(call *Call, payload *anypb.Any) + OnResponse func(call *Call, payload *anypb.Any) + OnShutdown func(conn *Conn) + OnWriteError func(conn *Conn, err error) + type Option interface + func ConcatOptions(a []Option, b ...Option) []Option + func WithObserver(o Observer) Option + type PacketConn interface + LocalAddr func() net.Addr + RemoteAddr func() net.Addr + type PacketDialer interface + DialPacket func(ctx context.Context, addr net.Addr) (PacketConn, error) + ListenPacket func(ctx context.Context, addr net.Addr) (PacketListener, error) + var DefaultPacketDialer PacketDialer + type PacketListener interface + AcceptPacket func(ctx context.Context) (PacketConn, error) + Addr func() net.Addr + type PacketReader interface + ReadPacket func(ctx context.Context) ([]byte, func(), error) + type PacketWriter interface + WritePacket func(ctx context.Context, p []byte) error + type PanicError struct + Err error + func (err PanicError) Error() string + func (err PanicError) Unwrap() error + type ProtocolViolationError struct + Err error + func (err ProtocolViolationError) Error() string + func (err ProtocolViolationError) IsRecoverable() bool + func (err ProtocolViolationError) Unwrap() error + type Queue struct + func NewQueue() *Queue + func (q *Queue) Done() + func (q *Queue) Push(value *anypb.Any) bool + func (q *Queue) Recv(blocking bool) (*anypb.Any, bool, bool) + type RecoverableError struct + Err error + func (err RecoverableError) Error() string + func (err RecoverableError) IsRecoverable() bool + func (err RecoverableError) Unwrap() error + type RecvStream interface + Recv func(blocking bool, out T) (ok bool, done bool, err error) + func NewRecvStream(call *Call) RecvStream[T] + type Role byte + const ClientRole + const ServerRole + const UnknownRole + func (enum Role) GoString() string + func (enum Role) MarshalText() ([]byte, error) + func (enum Role) String() string + type SendStream interface + CloseSend func() error + Send func(in T) error + func NewSendStream(call *Call) SendStream[T] + type Server struct + func ContextServer(ctx context.Context) *Server + func NewServer(pl PacketListener, h Handler, options ...Option) *Server + func (s *Server) Addr() net.Addr + func (s *Server) Close() error + func (s *Server) Handler() Handler + func (s *Server) Listener() PacketListener + func (s *Server) Shutdown(ctx context.Context) error + type ServerClosingError struct + func (err ServerClosingError) Error() string + type State uint32 + const StateClosed + const StateGoingAway + const StateRunning + const StateShuttingDown + func (enum State) GoString() string + func (enum State) MarshalText() ([]byte, error) + func (enum State) String() string + type Status struct + CanRetry bool + Code Status_Code + Details []*anypb.Any + Text string + func Abort(err error) *Status + func StatusFromError(err error) *Status + func (*Status) Descriptor() ([]byte, []int) + func (*Status) ProtoMessage() + func (status *Status) AsError() error + func (status *Status) CopyFrom(src *Status) + func (status *Status) FromError(err error) + func (status *Status) IsOK() bool + func (x *Status) GetCanRetry() bool + func (x *Status) GetCode() Status_Code + func (x *Status) GetDetails() []*anypb.Any + func (x *Status) GetText() string + func (x *Status) ProtoReflect() protoreflect.Message + func (x *Status) Reset() + func (x *Status) String() string + type StatusError struct + Status *Status + func (err StatusError) Error() string + type Status_Code int32 + const Status_ABORTED + const Status_ALREADY_EXISTS + const Status_CANCELLED + const Status_DATA_LOSS + const Status_DEADLINE_EXCEEDED + const Status_FAILED_PRECONDITION + const Status_INTERNAL + const Status_INVALID_ARGUMENT + const Status_NOT_FOUND + const Status_OK + const Status_OUT_OF_RANGE + const Status_PERMISSION_DENIED + const Status_RESOURCE_EXHAUSTED + const Status_UNAUTHENTICATED + const Status_UNAVAILABLE + const Status_UNIMPLEMENTED + const Status_UNKNOWN + func (Status_Code) Descriptor() protoreflect.EnumDescriptor + func (Status_Code) EnumDescriptor() ([]byte, []int) + func (Status_Code) Type() protoreflect.EnumType + func (x Status_Code) Enum() *Status_Code + func (x Status_Code) Number() protoreflect.EnumNumber + func (x Status_Code) String() string + type SumRequest struct + Input []int32 + func (*SumRequest) Descriptor() ([]byte, []int) + func (*SumRequest) ProtoMessage() + func (x *SumRequest) GetInput() []int32 + func (x *SumRequest) ProtoReflect() protoreflect.Message + func (x *SumRequest) Reset() + func (x *SumRequest) String() string + type SumResponse struct + Output int32 + func (*SumResponse) Descriptor() ([]byte, []int) + func (*SumResponse) ProtoMessage() + func (x *SumResponse) GetOutput() int32 + func (x *SumResponse) ProtoReflect() protoreflect.Message + func (x *SumResponse) Reset() + func (x *SumResponse) String() string + type TypeError struct + Actual protoreflect.FullName + Expect protoreflect.FullName + func (err TypeError) As(out any) bool + func (err TypeError) Error() string + type UnixPacketConn struct + Conn net.Conn + MaxPacketSize uint + Now func() time.Time + ReadTimeout time.Duration + ReadTimeoutEnabled bool + WriteTimeout time.Duration + WriteTimeoutEnabled bool + 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 struct + AcceptTimeout time.Duration + AcceptTimeoutEnabled bool + Dialer *net.Dialer + ListenConfig *net.ListenConfig + MaxPacketSize uint + Now func() time.Time + ReadTimeout time.Duration + ReadTimeoutEnabled bool + UnlinkOnClose bool + WriteTimeout time.Duration + WriteTimeoutEnabled bool + func (pd *UnixPacketDialer) DialPacket(ctx context.Context, addr net.Addr) (PacketConn, error) + func (pd *UnixPacketDialer) ListenPacket(ctx context.Context, addr net.Addr) (PacketListener, error) + type UnixPacketListener struct + AcceptTimeout time.Duration + AcceptTimeoutEnabled bool + Listener net.Listener + MaxPacketSize uint + Now func() time.Time + ReadTimeout time.Duration + ReadTimeoutEnabled bool + WriteTimeout time.Duration + WriteTimeoutEnabled bool + func (pl *UnixPacketListener) AcceptPacket(ctx context.Context) (pc PacketConn, err error) + func (pl *UnixPacketListener) Addr() net.Addr + func (pl *UnixPacketListener) Close() error + type UnmarshalError struct + Err error + Type string + func (err UnmarshalError) As(out any) bool + func (err UnmarshalError) Error() string + func (err UnmarshalError) Unwrap() error + type UnrecoverableError struct + Err error + func (err UnrecoverableError) Error() string + func (err UnrecoverableError) IsRecoverable() bool + func (err UnrecoverableError) Unwrap() error