util

package
v0.0.0-...-8cfca67 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GcloudCommonFlags = []string{
	"--quiet",
}

GcloudCommonFlags is a slice of common flags that should be added as arguments to all executions of the external gcloud command.

Functions

func ExecCommand

func ExecCommand(cmd *exec.Cmd, dir string) (string, error)

ExecCommand executes an exec.Cmd. If the command exits successfully, its stdout will be returned. If there's an error, the command's combined stdout and stderr will be returned in an error. The command will be run in the provided directory.

func LoadTestEndpoints

func LoadTestEndpoints() *openapi3.Swagger

LoadTestEndpoints loads a default test endpoint request (a GET / request expecting a 200 status code) into an openapi3.Swagger object (see github.com/getkin/kin-openapi).

func ValidateEndpoints

func ValidateEndpoints(serviceURL string, paths *openapi3.Paths, identityToken string) (bool, error)

ValidateEndpoints tests all paths (represented by openapi3.Paths) with all HTTP methods and given response bodies and make sure they respond with the expected status code. Returns a success bool based on whether all the tests passed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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