Kubeval is implemented in Go, and can be used as a Go library as well as being used as a command line tool.
The module can be imported like so:
import ( "github.com/instrumenta/kubeval/kubeval" )
The module provides one public function,
Validate, which can be used
results, err := kubeval.Validate(fileContents, fileName)
The method signature for
Validate(config byte, fileName string) (ValidationResult, error)
The simplest way of seeing it's usage is probably in the
command line tool source code.