Documentation ¶
Index ¶
- func ContactContext(next http.Handler) http.Handler
- func DatabaseContext(database moira.Database) func(next http.Handler) http.Handler
- func DateRange(defaultFrom, defaultTo string) func(next http.Handler) http.Handler
- func GetContactID(request *http.Request) string
- func GetDatabase(request *http.Request) moira.Database
- func GetFromStr(request *http.Request) string
- func GetLoggerEntry(request *http.Request) moira.Logger
- func GetLogin(request *http.Request) string
- func GetPage(request *http.Request) int64
- func GetSize(request *http.Request) int64
- func GetSubscriptionID(request *http.Request) string
- func GetTag(request *http.Request) string
- func GetTimeSeriesNames(request *http.Request) map[string]bool
- func GetToStr(request *http.Request) string
- func GetTriggerID(request *http.Request) string
- func GetTriggerTargetsSourceProvider(request *http.Request) *metricSource.SourceProvider
- func MetricSourceProvider(sourceProvider *metricSource.SourceProvider) func(next http.Handler) http.Handler
- func Paginate(defaultPage, defaultSize int64) func(next http.Handler) http.Handler
- func RequestLogger(logger moira.Logger) func(next http.Handler) http.Handler
- func SearchIndexContext(searcher moira.Searcher) func(next http.Handler) http.Handler
- func SetTimeSeriesNames(request *http.Request, timeSeriesNames map[string]bool)
- func SubscriptionContext(next http.Handler) http.Handler
- func TagContext(next http.Handler) http.Handler
- func TriggerContext(next http.Handler) http.Handler
- func UserContext(next http.Handler) http.Handler
- func WithLogEntry(r *http.Request, entry *apiLoggerEntry) *http.Request
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContactContext ¶
ContactContext gets contactID from parsed URI corresponding to trigger routes and set it to request context
func DatabaseContext ¶
DatabaseContext sets to requests context configured database
func DateRange ¶
DateRange gets from and to values from URI query and set it to request context. If query has not values sets given values
func GetContactID ¶
GetContactID gets ContactID string from request context, which was sets in TriggerContext middleware
func GetDatabase ¶
GetDatabase gets moira.Database realization from request context
func GetFromStr ¶
GetFromStr gets 'from' value from request context, which was sets in DateRange middleware
func GetLoggerEntry ¶
GetLoggerEntry gets logger entry with configured logger
func GetLogin ¶
GetLogin gets user login string from request context, which was sets in UserContext middleware
func GetSubscriptionID ¶
GetSubscriptionID gets subscriptionId string from request context, which was sets in SubscriptionContext middleware
func GetTimeSeriesNames ¶
GetTimeSeriesNames gets from requests context timeSeriesNames from saved trigger
func GetToStr ¶
GetToStr gets 'to' value from request context, which was sets in DateRange middleware
func GetTriggerID ¶
GetTriggerID gets TriggerID string from request context, which was sets in TriggerContext middleware
func GetTriggerTargetsSourceProvider ¶
GetTriggerTargetsSourceProvider gets trigger targets source provider
func MetricSourceProvider ¶
func MetricSourceProvider(sourceProvider *metricSource.SourceProvider) func(next http.Handler) http.Handler
MetricSourceProvider adds metrics source provider to context
func Paginate ¶
Paginate gets page and size values from URI query and set it to request context. If query has not values sets given values
func RequestLogger ¶
RequestLogger is overload method of go-chi.middleware RequestLogger with custom response logging
func SearchIndexContext ¶
SearchIndexContext sets to requests context configured moira.index.searchIndex
func SetTimeSeriesNames ¶
SetTimeSeriesNames sets to requests context timeSeriesNames from saved trigger
func SubscriptionContext ¶
SubscriptionContext gets subscriptionId from parsed URI corresponding to subscription routes and set it to request context
func TagContext ¶
TagContext gets tagName from parsed URI corresponding to tag routes and set it to request context
func TriggerContext ¶
TriggerContext gets triggerId from parsed URI corresponding to trigger routes and set it to request context
func UserContext ¶
UserContext get x-webauth-user header and sets it in request context, if header is empty sets empty string
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey used as key of api request context values
func (ContextKey) String ¶
func (key ContextKey) String() string