Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HeaderAcceptEncoding ... HeaderAcceptEncoding = "Accept-Encoding" // HeaderContentType ... HeaderContentType = "Content-Type" // HRPC Errord HeaderHRPCErr = "HRPC-Errord" )
Headers
View Source
const ( // MIMEApplicationJSON ... MIMEApplicationJSON = "application/json" // MIMEApplicationJSONCharsetUTF8 ... MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8 // MIMEApplicationProtobuf ... MIMEApplicationProtobuf = "application/protobuf" )
MIME types
View Source
const ModName = "server.echo"
ModName named a mod
Variables ¶
View Source
var ( // ErrGRPCResponseValid ... ErrGRPCResponseValid = grpc.Errorf(codes.Internal, "response valid") // ErrGRPCInvokeLen ... ErrGRPCInvokeLen = grpc.Errorf(codes.Internal, "invoke request without len 2 res") )
View Source
var ErrNotFound = HTTPError{ Code: http.StatusNotFound, Message: "not found", }
ErrNotFound defines StatusNotFound error.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string Port int Deployment string Debug bool DisableMetric bool DisableTrace bool // ServiceAddress service address in registry info, default to 'Host:Port' ServiceAddress string CertFile string PrivateFile string EnableTLS bool SlowQueryThresholdInMilli int64 // contains filtered or unexported fields }
Config HTTP config
func (*Config) WithLogger ¶
WithLogger ...
type GRPCProxyMessage ¶
type GRPCProxyMessage struct { Error int `protobuf:"varint,1,opt,name=error" json:"error"` Message string `protobuf:"bytes,2,opt,name=msg" json:"msg"` Data proto.Message `protobuf:"bytes,3,opt,name=data" json:"data"` }
GRPCProxyMessage ...
func (*GRPCProxyMessage) MarshalJSONPB ¶
func (m *GRPCProxyMessage) MarshalJSONPB(jsb *jsonpb.Marshaler) ([]byte, error)
MarshalJSONPB ...
type HTTPError ¶
HTTPError wraps handler error.
func NewHTTPError ¶
NewHTTPError constructs a new HTTPError instance.
type Server ¶
type Server struct { *echo.Echo // contains filtered or unexported fields }
Server ...
func (*Server) GracefulStop ¶
GracefulStop implements server.Server interface it will stop echo server gracefully
func (*Server) Info ¶
func (s *Server) Info() *server.ServiceInfo
Info returns server info, used by governor and consumer balancer
Click to show internal directories.
Click to hide internal directories.