Documentation
¶
Index ¶
Constants ¶
View Source
const (
NAMESPACE = "lauth"
)
Variables ¶
View Source
var (
Authz = NewEndpointMetrics("authz", []string{"method", "response_type", "client_id", "scope", "prompt", "authn_by"})
)
View Source
var ( HTTPLatency = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Namespace: NAMESPACE, Subsystem: "http", Name: "latency_seconds", Help: "The whole latency of each endpoint. It is includes non-core process like minifying or compression.", }, []string{"method", "path", "status"}, ) )
View Source
var (
Token = NewEndpointMetrics("token", []string{"grant_type", "client_id", "scope"})
)
View Source
var (
Userinfo = NewEndpointMetrics("userinfo", []string{"scope"})
)
Functions ¶
Types ¶
type Context ¶
type Context struct {
Error error
Metrics *EndpointMetrics
Labels prometheus.Labels
Method string
Path string
Remote string
// contains filtered or unexported fields
}
func StartAuthz ¶
func StartToken ¶
func StartUserinfo ¶
type EndpointMetrics ¶
type EndpointMetrics struct {
Name string
Labels []string
Latency *prometheus.SummaryVec
Count *prometheus.CounterVec
}
func NewEndpointMetrics ¶
func NewEndpointMetrics(name string, labels []string) *EndpointMetrics
func (*EndpointMetrics) MustRegister ¶
func (em *EndpointMetrics) MustRegister()
type ErrorReporter ¶
type LogContext ¶
type LogContext struct {
Method string
Path string
Remote string
Err error
Error string
Description string
Latency float64
// contains filtered or unexported fields
}
func StartLogging ¶
func StartLogging(ctx *gin.Context) *LogContext
func (*LogContext) Close ¶
func (c *LogContext) Close() error
func (*LogContext) Observe ¶
func (c *LogContext) Observe(v float64)
func (*LogContext) SetError ¶
func (c *LogContext) SetError(err error, reason, description string)
type ResponseCollcetor ¶
type ResponseCollcetor struct {
Upstream http.ResponseWriter
Code int
}
func (*ResponseCollcetor) Header ¶
func (w *ResponseCollcetor) Header() http.Header
func (*ResponseCollcetor) StatusClass ¶
func (w *ResponseCollcetor) StatusClass() string
func (*ResponseCollcetor) WriteHeader ¶
func (w *ResponseCollcetor) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.