Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIValidator ¶
type APIValidator struct {
// contains filtered or unexported fields
}
APIValidator validates CI configuration using GitLab API
func NewAPIValidator ¶
func NewAPIValidator(client *gitlab.Client, project string) *APIValidator
NewAPIValidator creates a new API validator
func (*APIValidator) SetDebugLogger ¶ added in v1.0.0
func (v *APIValidator) SetDebugLogger(debug gitlab.DebugLogger)
SetDebugLogger sets the debug logger for the validator
func (*APIValidator) Validate ¶
func (v *APIValidator) Validate(content []byte) Result
Validate validates the CI configuration using the GitLab API
type Error ¶
type Error struct {
Message string `yaml:"message" json:"message"`
Line int `yaml:"line,omitempty" json:"line,omitempty"`
Column int `yaml:"column,omitempty" json:"column,omitempty"`
Content string `yaml:"content,omitempty" json:"content,omitempty"` // Error line content
}
Error represents a validation error
type FileResult ¶ added in v0.2.0
type FileResult struct {
FilePath string `yaml:"file_path" json:"file_path"`
Valid bool `yaml:"valid" json:"valid"`
Stages []Result `yaml:"stages" json:"stages"`
}
FileResult represents validation results for a single file
type LocalValidator ¶
type LocalValidator struct {
Strict bool
}
LocalValidator validates YAML syntax and basic structure
func NewLocalValidator ¶
func NewLocalValidator(strict bool) *LocalValidator
NewLocalValidator creates a new local YAML validator
func (*LocalValidator) Validate ¶
func (v *LocalValidator) Validate(content []byte) Result
Validate validates the YAML content
type Result ¶
type Result struct {
Valid bool `yaml:"valid" json:"valid"`
Errors []Error `yaml:"errors,omitempty" json:"errors,omitempty"`
Warnings []Warning `yaml:"warnings,omitempty" json:"warnings,omitempty"`
Stage string `yaml:"stage" json:"stage"` // "local" or "api"
}
Result represents the result of a validation operation
Click to show internal directories.
Click to hide internal directories.