unsubscribetest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package unsubscribetest is an in-memory unsubscribe.Unsubscriber for tests of the packages that unsubscribe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

type Fake struct {
	Err func(link string) error
	// contains filtered or unexported fields
}

Fake keeps every link it is asked to call. Err, when set, answers each call instead of success, as a site that refuses or cannot be reached would; a failed call is kept too.

func (*Fake) Calls

func (f *Fake) Calls() []string

Calls returns the links called so far, oldest first.

func (*Fake) SetErr

func (f *Fake) SetErr(err func(link string) error)

SetErr changes Err while calls may be running.

func (*Fake) Unsubscribe

func (f *Fake) Unsubscribe(ctx context.Context, link string) error

Unsubscribe records link and returns Err's answer for it, or nil.

Jump to

Keyboard shortcuts

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