Versions in this module Expand all Collapse all v1 v1.0.6 Mar 2, 2025 v1.0.5 Mar 1, 2025 v1.0.4 Mar 1, 2025 v1.0.3 Mar 1, 2025 Changes in this version + const HeaderAcceptEncoding + const HeaderContentType + const HeaderHRPCErr + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationProtobuf + const ModName + const StatusAccepted + const StatusBadGateway + const StatusBadRequest + const StatusConflict + const StatusContinue + const StatusCreated + const StatusErrorCodeReturned + const StatusExpectationFailed + const StatusForbidden + const StatusFound + const StatusGatewayTimeout + const StatusGone + const StatusHTTPVersionNotSupported + const StatusInternalServerError + const StatusLengthRequired + const StatusMethodNotAllowed + const StatusMovedPermanently + const StatusMultipleChoices + const StatusNetworkAuthenticationRequired + const StatusNoContent + const StatusNonAuthoritativeInfo + const StatusNotAcceptable + const StatusNotFound + const StatusNotImplemented + const StatusNotModified + const StatusOK + const StatusPartialContent + const StatusPaymentRequired + const StatusPreconditionFailed + const StatusPreconditionRequired + const StatusProxyAuthRequired + const StatusRequestEntityTooLarge + const StatusRequestHeaderFieldsTooLarge + const StatusRequestTimeout + const StatusRequestURITooLong + const StatusRequestedRangeNotSatisfiable + const StatusResetContent + const StatusSeeOther + const StatusServiceUnavailable + const StatusSwitchingProtocols + const StatusTeapot + const StatusTemporaryRedirect + const StatusTooManyRequests + const StatusUnauthorized + const StatusUnavailableForLegalReasons + const StatusUnsupportedMediaType + const StatusUseProxy + var ErrGRPCInvokeLen = status.Errorf(codes.Internal, "invoke request without len 2 res") + var ErrGRPCResponseValid = status.Errorf(codes.Internal, "response valid") + var ErrNotFound = HTTPError + func StatusText(code int) string + type Config struct + Deployment string + DisableMetric bool + DisableTrace bool + Host string + Mode string + Port int + ServiceAddress string + SlowQueryThresholdInMilli int64 + func DefaultConfig() *Config + func RawConfig(key string) *Config + func StdConfig(name string) *Config + func (config *Config) Address() string + func (config *Config) MustBuild() *Server + func (config *Config) WithHost(host string) *Config + func (config *Config) WithLogger(logger *xlog.Logger) *Config + func (config *Config) WithPort(port int) *Config + type EmptyMessage struct + func (*EmptyMessage) ProtoMessage() + func (m *EmptyMessage) Reset() + func (m *EmptyMessage) String() string + type GRPCProxyMessage struct + Data proto.Message + Error int + Message string + func (*GRPCProxyMessage) ProtoMessage() + func (m *GRPCProxyMessage) MarshalJSONPB() ([]byte, error) + func (m *GRPCProxyMessage) Reset() + func (m *GRPCProxyMessage) String() string + type HTTPError struct + Code int + Message string + func NewHTTPError(code int, msg ...string) *HTTPError + func (e HTTPError) Error() string + type Server struct + Server *http.Server + func (s *Server) GracefulStop(ctx context.Context) error + func (s *Server) Healthz() bool + func (s *Server) Info() *server.ServiceInfo + func (s *Server) Serve() error + func (s *Server) Stop() error + func (s *Server) Upgrade(ws *WebSocket) gin.IRoutes + type WebSocket struct + Handler WebSocketFunc + Header http.Header + Pattern string + func WebSocketOptions(pattern string, handler WebSocketFunc, opts ...WebSocketOption) *WebSocket + func (ws *WebSocket) Upgrade(w http.ResponseWriter, r *http.Request) + type WebSocketConn interface + Close func() error + CloseHandler func() func(code int, text string) error + EnableWriteCompression func(enable bool) + LocalAddr func() net.Addr + NextReader func() (messageType int, r io.Reader, err error) + NextWriter func(messageType int) (io.WriteCloser, error) + PingHandler func() func(appData string) error + PongHandler func() func(appData string) error + ReadMessage func() (messageType int, p []byte, err error) + RemoteAddr func() net.Addr + SetCloseHandler func(h func(code int, text string) error) + SetCompressionLevel func(level int) error + SetPingHandler func(h func(appData string) error) + SetPongHandler func(h func(appData string) error) + SetReadDeadline func(t time.Time) error + SetReadLimit func(limit int64) + SetWriteDeadline func(t time.Time) error + Subprotocol func() string + UnderlyingConn func() net.Conn + WriteControl func(messageType int, data []byte, deadline time.Time) error + WriteMessage func(messageType int, data []byte) error + WritePreparedMessage func(pm *websocket.PreparedMessage) error + type WebSocketFunc func(WebSocketConn, error) + type WebSocketOption func(*WebSocket)