Documentation ¶
Index ¶
- Variables
- func AddCommon(rootCmd *cobra.Command)
- func EncodeJSON(data interface{}) string
- func ErrString(maybeErr error) any
- func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
- func MakeFileCommand(checkFn func(*FileContext)) func(cmd *cobra.Command, args []string) error
- func ProgressCount()
- func ProgressEnd()
- func ProgressStart(fcs []FileContext)
- func ProgressUpdate(good int, bad int, fc FileContext)
- type ErrorAtPosition
- type FileContext
- func (fc *FileContext) IsDir() bool
- func (fc *FileContext) IsFile() bool
- func (fc *FileContext) ReadFile() ([]byte, error)
- func (fc *FileContext) RecordResult(Code string, Success bool, Detail map[string]interface{})
- func (fc *FileContext) Reset()
- func (fc *FileContext) Size() int64
- func (fc *FileContext) Stat() (os.FileInfo, error)
- func (fc *FileContext) Success() bool
- type Globber
- type Namespaces
- type SchemaOptions
- type TestResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Debug bool OutputFormat = argtype.NewStringSet("OutputFormat", "text", []string{"text", "json", "markdown", "filenames"}) )
View Source
var (
DEFAULT_IGNORE_FILE = ".gitignore"
)
Functions ¶
func EncodeJSON ¶
func EncodeJSON(data interface{}) string
func IfThenElse ¶
func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
IfThenElse is a substitute for golang missing a ternary operator
func MakeFileCommand ¶
func MakeFileCommand(checkFn func(*FileContext)) func(cmd *cobra.Command, args []string) error
func ProgressCount ¶
func ProgressCount()
ProgressCount called when loading the list (before end is known)
func ProgressUpdate ¶
func ProgressUpdate(good int, bad int, fc FileContext)
ProgressUpdate update the progress bar
Types ¶
type ErrorAtPosition ¶
func NewErrorAtPosition ¶
func NewErrorAtPosition(err error, pos int) *ErrorAtPosition
func (*ErrorAtPosition) Error ¶
func (eap *ErrorAtPosition) Error() string
type FileContext ¶
type FileContext struct { FilePath string // contains filtered or unexported fields }
FileContext data about a file being tested
func (*FileContext) ReadFile ¶
func (fc *FileContext) ReadFile() ([]byte, error)
ReadFile ioutil.ReadFile, possibly cached
func (*FileContext) RecordResult ¶
func (fc *FileContext) RecordResult(Code string, Success bool, Detail map[string]interface{})
func (*FileContext) Reset ¶
func (fc *FileContext) Reset()
func (*FileContext) Size ¶
func (fc *FileContext) Size() int64
func (*FileContext) Stat ¶
func (fc *FileContext) Stat() (os.FileInfo, error)
Stat os.Stat, possibly cached
func (*FileContext) Success ¶
func (fc *FileContext) Success() bool
type Globber ¶
type Globber struct {
// contains filtered or unexported fields
}
Globber is an optional min/max pair
type Namespaces ¶
func GetNamespaces ¶
func GetNamespaces(reader io.Reader) (Namespaces, error)
type SchemaOptions ¶
type SchemaOptions struct {
// contains filtered or unexported fields
}
func (*SchemaOptions) AddFlags ¶
func (so *SchemaOptions) AddFlags(theCmd *cobra.Command)
func (*SchemaOptions) Prepare ¶
func (so *SchemaOptions) Prepare() error
func (*SchemaOptions) Validate ¶
func (so *SchemaOptions) Validate(data interface{}) error
type TestResult ¶
TestResult is results of a single test
Click to show internal directories.
Click to hide internal directories.