tests

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: 7 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 tests holds the HTTP handlers of the test definitions of an app: they parse the request, call the test 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 test definition routes of an app.

func New

func New(svc Service) *Handler

New builds the handler on the service.

func (*Handler) Register

func (h *Handler) Register(appAPI *gin.RouterGroup)

Register adds the routes to the group of an app, which must run the ResolveProject and ResolveApp middlewares.

type Service

type Service interface {
	List(ctx context.Context, sc service.Scope) ([]service.ListEntry, error)
	Get(ctx context.Context, ref service.TestRef) (*models.Test, error)
	Create(ctx context.Context, sc service.Scope, in service.NewTest) (*models.Test, error)
	Update(ctx context.Context, ref service.TestRef, in service.Edit) (*models.Test, error)
}

Service is what the handlers need from the test service.

Jump to

Keyboard shortcuts

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