Documentation ¶
Index ¶
- Variables
- func ClientWithCompressor(compressor compress.Compressor) clientOption
- func ClientWithSerializer(s serialize.Serializer) clientOption
- func ContextWithOneway(ctx context.Context) context.Context
- func IsOneWayContext(ctx context.Context) bool
- func ReadMsg(conn net.Conn) ([]byte, error)
- type Client
- type Proxy
- type Server
- func (s *Server) Invoke(ctx context.Context, req *message.Request) (*message.Response, error)
- func (s *Server) Register(srv Service)
- func (s *Server) RegisterCompressor(compressor compress.Compressor)
- func (s *Server) RegisterSerializer(serializer serialize.Serializer)
- func (s *Server) Start(addr string) error
- type Service
- type UserServiceImpl
- type UserServiceTimeOut
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServiceIsNil = errors.New("[rpc] service 不能为nil") ErrStructPtrOnly = errors.New("[rpc] service 只能传入结构体指针") )
Functions ¶
func ClientWithCompressor ¶ added in v0.1.47
func ClientWithCompressor(compressor compress.Compressor) clientOption
func ClientWithSerializer ¶ added in v0.1.46
func ClientWithSerializer(s serialize.Serializer) clientOption
func ContextWithOneway ¶ added in v0.1.46
func IsOneWayContext ¶ added in v0.1.46
Types ¶
type Server ¶ added in v0.1.43
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterCompressor ¶ added in v0.1.47
func (s *Server) RegisterCompressor(compressor compress.Compressor)
func (*Server) RegisterSerializer ¶ added in v0.1.46
func (s *Server) RegisterSerializer(serializer serialize.Serializer)
type UserServiceImpl ¶ added in v0.1.43
type UserServiceImpl struct {
testdata.UserService
}
func (*UserServiceImpl) GetUserByID ¶ added in v0.1.43
func (u *UserServiceImpl) GetUserByID(ctx context.Context, req *testdata.GetUserByIDReq) (*testdata.GetUserByIDResp, error)
func (*UserServiceImpl) GetUserByIDProto ¶ added in v0.1.46
func (u *UserServiceImpl) GetUserByIDProto(ctx context.Context, req *gen.GetUserByIdReq) (*gen.GetUserByIdResp, error)
type UserServiceTimeOut ¶ added in v0.1.47
type UserServiceTimeOut struct {
// contains filtered or unexported fields
}
func (*UserServiceTimeOut) GetUserByID ¶ added in v0.1.47
func (u *UserServiceTimeOut) GetUserByID(ctx context.Context, req *testdata.GetUserByIDReq) (*testdata.GetUserByIDResp, error)
func (*UserServiceTimeOut) Name ¶ added in v0.1.47
func (u *UserServiceTimeOut) Name() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.