internal

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package internal contains miscellaneous functions and types that are internal to the syspolicy packages.

Index

Constants

This section is empty.

Variables

View Source
var OSForTesting lazy.SyncValue[string]

OSForTesting is the operating system override used for testing. It follows the same naming convention as version.OS.

Functions

func EqualJSONForTest

func EqualJSONForTest(tb TB, j1, j2 jsontext.Value) (s1, s2 string, equal bool)

EqualJSONForTest compares the JSON in j1 and j2 for semantic equality. It returns "", "", true if j1 and j2 are equal. Otherwise, it returns indented versions of j1 and j2 and false.

func OS

func OS() string

OS is like version.OS, but supports a test hook.

Types

type TB

type TB interface {
	Helper()
	Cleanup(func())
	Logf(format string, args ...any)
	Error(args ...any)
	Errorf(format string, args ...any)
	Fatal(args ...any)
	Fatalf(format string, args ...any)
}

TB is a subset of testing.TB that we use to set up test helpers. It's defined here to avoid pulling in the testing package.

Directories

Path Synopsis
Package loggerx provides logging functions to the rest of the syspolicy packages.
Package loggerx provides logging functions to the rest of the syspolicy packages.
Package metrics provides logging and reporting for policy settings and scopes.
Package metrics provides logging and reporting for policy settings and scopes.

Jump to

Keyboard shortcuts

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