lib

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthEnvVar  = "CENSYS_API_TOKEN"
	OrgIDEnvVar = "CENSYS_ORG_ID"
)

Variables

This section is empty.

Functions

func ConfigureAuth

func ConfigureAuth(dataDir string, binaryPath string) error

ConfigureAuth sets up authentication credentials for e2e tests by running config commands. It requires CENSYS_API_TOKEN and CENSYS_ORG_ID environment variables to be set. It also requires the binary path to be passed in.

func E2EEnvVars

func E2EEnvVars(dataDir string) []string

E2EEnvVars returns the environment variables that are used for all e2e tests. It configures a custom data directory and disables color/spinner output for deterministic testing. If the data dir is empty, which will be the case for the smoke test, then that environment variable is not set.

func FindBinary

func FindBinary() string

FindBinary searches for the censys binary in common relative paths from the test directory. It returns the absolute path if found, or an empty string if not found.

Types

type CommandResult

type CommandResult struct {
	ExitCode int
	Stdout   []byte
	Stderr   []byte
	Error    error
}

CommandResult captures the output and exit status of a command execution.

func RunCommand

func RunCommand(cmd *exec.Cmd) CommandResult

RunCommand executes a command and captures its stdout, stderr, exit code, and any errors.

Jump to

Keyboard shortcuts

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