Versions in this module Expand all Collapse all v1 v1.0.0 May 27, 2024 Changes in this version + var DefaultUnaryInterceptor grpc.UnaryServerInterceptor = func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error) + func Err(s any) error + func GetErrorCode(err error) int + func GetErrorMessage(err error) string + func RoundRobin() grpc.DialOption + func UnaryInterceptorWithLogPrefix(logpfx string, skipLogResp bool, ctx context.Context, req interface{}, ...) (resp interface{}, err error) + func UseCodec(codec encoding.Codec) grpc.DialOption + type ClientManager struct + func NewClientManager(d resolver.Builder) *ClientManager + func (gx *ClientManager) Close() + func (gx *ClientManager) GetClient(serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error) + type DescAndImpl struct + Desc *grpc.ServiceDesc + Impl any + type JsonBytesCodec struct + func (c JsonBytesCodec) Marshal(v interface{}) ([]byte, error) + func (c JsonBytesCodec) Name() string + func (c JsonBytesCodec) Unmarshal(data []byte, v interface{}) error + type JsonCodec struct + func (c JsonCodec) Marshal(v interface{}) ([]byte, error) + func (c JsonCodec) Name() string + func (c JsonCodec) Unmarshal(data []byte, v interface{}) error + type Server struct + Config *ServerOption + PortProvider discovery.PortProvider + Register discovery.Register + ServiceDescMap ut2.IMap[string, *DescAndImpl] + func NewServer(cfg *ServerOption, p discovery.PortProvider, r discovery.Register) *Server + func (gx *Server) Serve() error + func (s *Server) Close() + func (s *Server) RegisterService(desc *grpc.ServiceDesc, impl interface{}) + type ServerOption struct + Host string + Name string + UnaryInterceptor grpc.UnaryServerInterceptor