protocols

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 New

func New(svc Service) *Handler

New builds the handler on the service.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL