validator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 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) 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 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