Help us shape the future of Go! Take the 2026 Go Developer Survey

testutil

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeDecode

func EncodeDecode(ctx context.Context, t *testing.T, ks encid.KeyStore, numTypes int)

func TestKeyStore added in v2.2.0

func TestKeyStore(t *testing.T, factory func(t *testing.T) KeyStoreTester)

TestKeyStore executes the complete encid.KeyStore test suite against the KeyStoreTester produced by factory.

Types

type KeyStore

type KeyStore struct {
	NumTypes, Ver int
}

func (KeyStore) DecoderByID

func (tks KeyStore) DecoderByID(_ context.Context, keyID int64) (int, encid.Decrypter, error)

func (KeyStore) EncoderByType

func (tks KeyStore) EncoderByType(_ context.Context, typ int) (int64, encid.Encrypter, error)

func (KeyStore) Version

func (tks KeyStore) Version() int

type KeyStoreTester added in v2.2.0

type KeyStoreTester interface {
	encid.KeyStore
	NewKey(ctx context.Context, typ, keysize int) (int64, error)
}

KeyStoreTester is implemented by keystore implementations or fixtures that can be tested with TestKeyStore.

Jump to

Keyboard shortcuts

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