testutils

package
v0.0.0-...-5da7bf1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(node ast.Node)

func Exec

func Exec(cmd *cobra.Command, args ...string) (out []byte, err error)

Exec executes the cobra command and collects the output into a buffer for further analysis.

func ExecWithStdout

func ExecWithStdout(cmd *cobra.Command, args ...string) (out []byte, err error)

ExecWithStdout writes its output to stdout/stderr as well as whatever is previously defined to be the target (like a file)

func FilePath

func FilePath(relative string, up ...int) string

func FilePaths

func FilePaths(regex, relativeDirPath string) (string, []string)

func LoadSpec

func LoadSpec(relativeFilePath string) (doc *openapi3.T)

LoadSpec loads an openapi spec relative to the current go file's location.

func LoadSpecs

func LoadSpecs(regex, dirPath string) map[string]*openapi3.T

LoadSpecs looks into the directory path relative to the current go file's directory path. You may pass a regular expression to match a specific subset of files in the passed directory.

func LoadTemplates

func LoadTemplates() (*token.FileSet, map[string]*ast.File)

LoadTemplates loads all .go files starting with template_ or ending with _template.go from the templates folder

func NodeString

func NodeString(n ast.Node) string

func NodeWithFileSetString

func NodeWithFileSetString(n ast.Node, fset *token.FileSet) string

func StackTrace

func StackTrace() []string

func StackTraceString

func StackTraceString() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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