Documentation
¶
Overview ¶
Package protocols holds the HTTP handlers of the protocols of a test run: the protocol page and the baselines its performance is compared with. They parse the request, call the protocol service and write the answer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the protocol routes of an app.
func (*Handler) RegisterBaselines ¶
func (h *Handler) RegisterBaselines(appAPI *gin.RouterGroup)
RegisterBaselines adds the baseline routes to the group of an app.
func (*Handler) RegisterProtocols ¶
func (h *Handler) RegisterProtocols(appAPI *gin.RouterGroup)
RegisterProtocols adds the protocol page to the group of an app, which must run the ResolveProject and ResolveApp middlewares.
type Service ¶
type Service interface {
Page(ctx context.Context, key protocol.Key) (*models.TestRun, error)
Baselines(ctx context.Context, key protocol.Key, f protocol.Filter) (*protocol.Baselines, error)
Baseline(ctx context.Context, key protocol.Key, choice protocol.Choice) (*protocol.Baseline, error)
}
Service is what the handlers need from the protocol service.