Documentation
¶
Index ¶
- Constants
- func Debug(ctx context.Context, format string, v ...interface{})
- func Error(ctx context.Context, format string, v ...interface{})
- func ErrorPanic(err error)
- func FetchServiceConn(name string, s *Server) *grpc.ClientConn
- func FetchServiceConnByCtx(ctx context.Context, name string) *grpc.ClientConn
- func GetValidIP() string
- func GetValidPort(ip string) int
- func Info(ctx context.Context, format string, v ...interface{})
- func NewInterceptors(s *Server) *interceptors
- func RegisterHttpServiceServer(s *grpc.Server, srv HttpServiceServer)
- func ReleaseLogger(s *Server)
- type HttpReq
- func (*HttpReq) Descriptor() ([]byte, []int)
- func (m *HttpReq) GetBody() string
- func (m *HttpReq) GetMethod() string
- func (m *HttpReq) GetServiceName() string
- func (*HttpReq) ProtoMessage()
- func (m *HttpReq) Reset()
- func (m *HttpReq) String() string
- func (m *HttpReq) XXX_DiscardUnknown()
- func (m *HttpReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HttpReq) XXX_Merge(src proto.Message)
- func (m *HttpReq) XXX_Size() int
- func (m *HttpReq) XXX_Unmarshal(b []byte) error
- type HttpRsp
- func (*HttpRsp) Descriptor() ([]byte, []int)
- func (m *HttpRsp) GetCode() int32
- func (m *HttpRsp) GetMsg() string
- func (m *HttpRsp) GetReply() string
- func (*HttpRsp) ProtoMessage()
- func (m *HttpRsp) Reset()
- func (m *HttpRsp) String() string
- func (m *HttpRsp) XXX_DiscardUnknown()
- func (m *HttpRsp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HttpRsp) XXX_Merge(src proto.Message)
- func (m *HttpRsp) XXX_Size() int
- func (m *HttpRsp) XXX_Unmarshal(b []byte) error
- type HttpServiceClient
- type HttpServiceServer
- type Logger
- type Server
Constants ¶
View Source
const (
Skey = "_server"
)
Variables ¶
This section is empty.
Functions ¶
func ErrorPanic ¶
func ErrorPanic(err error)
func FetchServiceConn ¶
func FetchServiceConn(name string, s *Server) *grpc.ClientConn
func FetchServiceConnByCtx ¶
func FetchServiceConnByCtx(ctx context.Context, name string) *grpc.ClientConn
func GetValidIP ¶
func GetValidIP() string
func GetValidPort ¶
func NewInterceptors ¶
func NewInterceptors(s *Server) *interceptors
func RegisterHttpServiceServer ¶
func RegisterHttpServiceServer(s *grpc.Server, srv HttpServiceServer)
func ReleaseLogger ¶
func ReleaseLogger(s *Server)
Types ¶
type HttpReq ¶
type HttpReq struct { ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HttpReq) Descriptor ¶
func (*HttpReq) GetServiceName ¶
func (*HttpReq) ProtoMessage ¶
func (*HttpReq) ProtoMessage()
func (*HttpReq) XXX_DiscardUnknown ¶
func (m *HttpReq) XXX_DiscardUnknown()
func (*HttpReq) XXX_Marshal ¶
func (*HttpReq) XXX_Unmarshal ¶
type HttpRsp ¶
type HttpRsp 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"` Reply string `protobuf:"bytes,3,opt,name=reply,proto3" json:"reply,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func Call_HttpService_Call ¶
func (*HttpRsp) Descriptor ¶
func (*HttpRsp) ProtoMessage ¶
func (*HttpRsp) ProtoMessage()
func (*HttpRsp) XXX_DiscardUnknown ¶
func (m *HttpRsp) XXX_DiscardUnknown()
func (*HttpRsp) XXX_Marshal ¶
func (*HttpRsp) XXX_Unmarshal ¶
type HttpServiceClient ¶
type HttpServiceClient interface {
Call(ctx context.Context, in *HttpReq, opts ...grpc.CallOption) (*HttpRsp, error)
}
HttpServiceClient is the client API for HttpService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewHttpServiceClient ¶
func NewHttpServiceClient(cc *grpc.ClientConn) HttpServiceClient
type HttpServiceServer ¶
HttpServiceServer is the server API for HttpService service.
Click to show internal directories.
Click to hide internal directories.