test

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadTestCert

func ReadTestCert(inPath string) *x509.Certificate

ReadTestCert loads a x509.Certificate from the given inPath which is assumed to be relative to `testdata/`.

Important: ReadTestCert is only appropriate for unit tests. It will panic if the inPath file can not be loaded.

func TestLint

func TestLint(lintName string, testCertFilename string) *lint.LintResult

TestLint executes the given lintName against a certificate read from a testcert data file with the given filename. Filenames should be relative to `testdata/` and not absolute file paths.

Important: TestLint is only appropriate for unit tests. It will panic if the lintName is not known or if the testCertFilename can not be loaded, or if the lint result is nil.

func TestLintCert

func TestLintCert(lintName string, cert *x509.Certificate) *lint.LintResult

TestLintCert executes a lint with the given name against an already parsed certificate. This is useful when a unit test reads a certificate from disk and then mutates it in some way before trying to lint it.

Important: TestLintCert is only appropriate for unit tests. It will panic if the lintName is not known or if the lint result is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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