Documentation
¶
Index ¶
- Constants
- func HandlerKey(g *HandlerGroup, h *Handler) string
- func StatusCode(err error) int
- type ClientTLS
- type Context
- type Endpoint
- type ErrorBody
- type Handler
- type HandlerFunc
- type HandlerGroup
- type Middleware
- type RequestInfo
- type ResponseInfo
- type Router
- type ServerTLS
- type Stats
- type ThrottleConfig
Constants ¶
View Source
const ( ContextKeyRequestInfo = common.ContextKeyAPIRequestInfo ContextKeyResponseInfo = common.ContextKeyAPIResponseInfo ContextKeyError = common.ContextKeyAPIError ContextKeyCredential = common.ContextKeyCredential ContextKeySession = common.ContextKeySession ContextKeyTrace = common.ContextKeyTrace ContextKeyDB = common.ContextKeyDB ContextKeyLogger = common.ContextKeyLogger CookiesKeySession = "JSESSIONID" HeaderKeyTrace = "X-TRACE-ID" HeaderKeyFile = "X-FILE-ID" HeaderKeyJob = "X-JOB-ID" HeaderKeySession = "X-SESSION-ID" HeaderKeyAPIToken = "X-API-KEY" HeaderKeyAgentID = "X-AGENT-ID" HeaderKeyClientCert = "X-Ssl-Certificate" // from nginx proxy_set_header $ssl_client_escaped_cert HeaderKeyClientVerify = "X-Ssl-Certificate-Verify" // from nginx proxy_set_header $ssl_client_verify QueryParamSession = "sid" QueryParamJob = "job" LabelKeySession = "session" LabelKeyNamespace = "namespace" LabelKeyUsername = "username" )
View Source
const DefaultAPIPrefix = "/"
View Source
const ErrorSourceUnknown = "Unknown"
Variables ¶
This section is empty.
Functions ¶
func HandlerKey ¶
func HandlerKey(g *HandlerGroup, h *Handler) string
func StatusCode ¶
Types ¶
type ClientTLS ¶
type ClientTLS struct {
CertBundle certutil.CertBundle
AuthType tls.ClientAuthType
}
type Endpoint ¶
func NewEndpoint ¶
type ErrorBody ¶
type ErrorBody struct {
Origin error `json:"-"` // keep the original error to trace the stack
Source string `json:"source,omitempty"` // source
Status int `json:"status,omitempty"` // http status code
Code string `json:"code,omitempty"` // customized error code
Kind string `json:"kind,omitempty"` // error category
Message string `json:"message,omitempty"`
Details labels.Set `json:"details,omitempty"`
}
type Handler ¶
type Handler struct {
Method string `json:"method"`
Path string `json:"path"`
Middlewares []string `json:"middlewares"`
Permission rbac.Permission `json:"permission"`
Poll bool `json:"poll"`
Throttle *ThrottleConfig `json:"throttle,omitempty"`
Func string `json:"func"`
}
type HandlerFunc ¶
type HandlerGroup ¶
type Middleware ¶
type Middleware interface {
common.Service
Func(echo.HandlerFunc) echo.HandlerFunc
}
type RequestInfo ¶
type RequestInfo struct {
URI string
Method string
Path string
RawPath string
TraceID string
IP string
StartedAt time.Time
Handler *Handler
HandlerGroup *HandlerGroup
}
func (*RequestInfo) Key ¶
func (s *RequestInfo) Key() string
type ResponseInfo ¶
type ServerTLS ¶
type ServerTLS struct {
CertBundle certutil.CertBundle
AuthEnabled bool
}
type Stats ¶
type Stats struct {
RequestInfo
ResponseInfo
}
type ThrottleConfig ¶
Click to show internal directories.
Click to hide internal directories.