tests

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tests contains common storage tests and some test utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryUntilAvailable

func RetryUntilAvailable(t *testing.T, serviceName, addr string, f func(ctx context.Context) error)

RetryUntilAvailable calls callback repeatedly until callback return nil error or until test timeout will be reached.

func TestCredentials

func TestCredentials(t *testing.T, cred Credentials)

TestCredentials runs different tests for given credentials storage implementation.

func TestPeerStorage

func TestPeerStorage(t *testing.T, st storage.PeerStorage)

TestPeerStorage runs different tests for given peer storage implementation.

func TestSessionStorage

func TestSessionStorage(t *testing.T, s session.Storage)

TestSessionStorage runs different tests for given session storage implementation.

Types

type Credentials

type Credentials interface {
	auth.Credentials
	SavePhone(ctx context.Context, phone string) error
	SavePassword(ctx context.Context, password string) error
}

Credentials is a KV credential storage abstraction.

Jump to

Keyboard shortcuts

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