test

package
v0.0.0-...-7d79ef2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package test adds helper utilities for testing run.Group enabled services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRQService

type IRQService interface {
	run.Service
	io.Closer
}

IRQService is a run.Service and io.Closer implementation. It can be registered with run.Group and calling Close will initiate shutdown of the run.Group. This is primarily used for unit tests of run.Group enabled services and handlers.

func NewIRQService

func NewIRQService(cleanup func()) IRQService

NewIRQService returns a IRQService for usage in run.Group tests. Use the Close() method to shutdown a run.Group. The Serve() method should not be called outside the internal run.Group logic as run.Service is to be managed by run.Group.

type Svc

type Svc struct {
	SvcName string
	Execute func(ctx context.Context) error
}

Svc allows one to quickly bootstrap a run.GroupService from simple functions. This is especially useful for unit tests.

func (Svc) Name

func (t Svc) Name() string

Name implements run.Unit.

func (Svc) Serve

func (t Svc) Serve(ctx context.Context) error

Serve implements run.Service.

Jump to

Keyboard shortcuts

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