validator

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 6 Imported by: 0

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

type Validator

type Validator interface {
	Validate(content []byte) Result
}

Validator defines the interface for validation operations

type Warning

type Warning struct {
	Message string `yaml:"message" json:"message"`
	Line    int    `yaml:"line,omitempty" json:"line,omitempty"`
}

Warning represents a validation warning

Jump to

Keyboard shortcuts

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