simplelogintest

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 10 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 simplelogintest is a fake SimpleLogin API for tests: a user with mailboxes, aliases and contacts, served over HTTP on loopback.

Index

Constants

View Source
const ReverseDomain = "rev.sl.example"

ReverseDomain is the domain the fake's reverse aliases are at.

Variables

This section is empty.

Functions

func ReverseAlias

func ReverseAlias(aliasID int64, addr string) string

ReverseAlias is the reverse alias the fake gives contact addr of an alias.

Types

type Server

type Server struct {
	URL string
	Key string
	// contains filtered or unexported fields
}

Server is a fake SimpleLogin instance with one user, whose API key is Key. A contact whose address starts with "premium" is refused, as SimpleLogin refuses reverse aliases to a free plan.

func Start

func Start(t testing.TB, key string, mailboxes ...string) *Server

Start serves a fake with key and mailboxes (the first the default, each verified) and no alias.

func (*Server) AddAlias

func (s *Server) AddAlias(email, name string, mailboxes ...string) int64

AddAlias gives the user an alias forwarding to the mailboxes (addresses) and returns its id. Its latest activity is a forward from a contact whose reverse alias is at ReverseDomain, as SimpleLogin reports one.

func (*Server) Alias

func (s *Server) Alias(id int64) (simplelogin.Alias, bool)

Alias is the alias id as the fake holds it.

func (*Server) Requests

func (s *Server) Requests() []string

Requests are the requests served so far, as "METHOD /path?query".

Jump to

Keyboard shortcuts

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