Documentation
¶
Index ¶
- Constants
- Variables
- func NewConfigCmd() *cobra.Command
- func NewExportCmd(e exporter.Exporter) *cobra.Command
- func NewReportCmd(configFile *string, reportFile *string) *cobra.Command
- func NewRootCmd(e exporter.Exporter) *cobra.Command
- func NewValidateCmd(configFile *string, reportFile *string) *cobra.Command
- func Open(filename string) (io.Reader, error)
- func OpenAll(filenames ...string) ([]io.Reader, error)
- func OpenAndDecode[T any](filename string, fileType FileType) (*T, error)
- func OpenAndDecodeOrCreate[T any](filename string, fileType FileType) (*T, error)
- func OpenAndEncode(filename string, fileType FileType, object any) error
- func OpenOrCreate(filename string) (io.ReadWriter, error)
- func OpenOrCreateInDirectory(directoryOrFilename string, FilenameIfDirectory string) (io.ReadWriter, error)
- type Decoder
- type FileType
Constants ¶
View Source
const DefaultConfigFile = "gatecheck.yaml"
View Source
const DefaultReportFile = "gatecheck-report.json"
View Source
const GatecheckLogo string = `` /* 5388-byte string literal not displayed */
View Source
const VersionNumber = "0.0.5"
Variables ¶
View Source
var ErrorDecode = errors.New("error decoding a file")
View Source
var ErrorEncode = errors.New("error encoding a file")
View Source
var ErrorFileAccess = errors.New("file access error")
View Source
var ErrorFileExists = errors.New("file already exists")
View Source
var ErrorFileNotExists = errors.New("file does not exists")
View Source
var ErrorValidation = errors.New("report failed validation")
Functions ¶
func NewConfigCmd ¶ added in v0.0.2
func NewReportCmd ¶ added in v0.0.2
func NewValidateCmd ¶ added in v0.0.2
func OpenAndDecode ¶ added in v0.0.5
OpenAndDecode opens a file and decodes it into the desired object
func OpenAndDecodeOrCreate ¶ added in v0.0.5
OpenAndDecodeOrCreate will return a new object if the file did not exist. Will not write the file
func OpenAndEncode ¶ added in v0.0.5
OpenAndEncode opens a file and encodes the object based in the fileType format
func OpenOrCreate ¶ added in v0.0.5
func OpenOrCreate(filename string) (io.ReadWriter, error)
OpenOrCreate if the file doesn't exist it will be created
func OpenOrCreateInDirectory ¶ added in v0.0.5
func OpenOrCreateInDirectory(directoryOrFilename string, FilenameIfDirectory string) (io.ReadWriter, error)
OpenOrCreateInDirectory can be used to create new files by passing a filename or the name of a directory. If the name of an existing directory is passed, a new file will be created in that directory
Types ¶
Click to show internal directories.
Click to hide internal directories.