cachetestutils

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cachetestutils export cache test functionalities used by other packages.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DbName is database name exported for tests
	//go:linkname DbName github.com/ubuntu/authd/internal/users/cache.dbName
	DbName string
)

Functions

func CreateDBFromYAML

func CreateDBFromYAML(t *testing.T, src, destDir string)

CreateDBFromYAML creates the database inside destDir and loads the src file content into it.

func DbfromYAML

func DbfromYAML(r io.Reader, destDir string) error

DbfromYAML loads a yaml formatted of the buckets from a reader and dump it into destDir, with its dbname.

func DumpNormalizedYAML

func DumpNormalizedYAML(c *cache.Cache) (string, error)

DumpNormalizedYAML gets the content of the database, normalizes it (so that it can be compared with a golden file) and returns it as a YAML string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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