value

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package value provides the transport structures used to unmarshal the config value types like string patterns, integer ranges, etc. from config files and convert them into the matching domain values through their Config methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	// Level stores the severity level
	// of the issue as a string read from the config file.
	Level string `yaml:"level,omitempty"`
}

Issue is the transport representation of the issue severity level used by the gitamix linter to report problems.

func (Issue) Config

func (i Issue) Config() issue.Type

Config converts the Issue into the domain value.

func (Issue) Empty

func (i Issue) Empty() bool

Empty reports whether the Issue is empty, i.e. no severity level is set.

type Pattern

type Pattern struct {
	// Issue stores the transport representation
	// of the issue type level associated with the pattern value.
	Issue Issue `yaml:"issue,omitempty"`

	// Pattern stores the exact string pattern
	// in its transport representation.
	Pattern string `yaml:"pattern,omitempty"`
}

Pattern is the transport representation of a pattern config value, pairing an exact string pattern with the issue type level used to report violations of the pattern.

func (Pattern) Config

func (p Pattern) Config() value.String

Config converts the Pattern into the domain value.

When empty, the zero string value is returned. Otherwise a new string value is built from the issue level and the pattern.

func (Pattern) Empty

func (p Pattern) Empty() bool

Empty reports whether the Pattern is empty, i.e. neither the issue level nor the pattern string is set.

type Range

type Range struct {
	// Issue stores the transport representation
	// of the issue type level associated with the range value.
	Issue Issue `yaml:"issue,omitempty"`

	// Min stores the lower bound of the interval
	// in its transport representation.
	Min int `yaml:"min,omitempty"`

	// Max stores the upper bound of the interval
	// in its transport representation.
	Max int `yaml:"max,omitempty"`
}

Range is the transport representation of a range config value, an inclusive [min, max] interval paired with the issue type level used to report violations of the interval.

func (Range) Config

func (r Range) Config() value.Range

Config converts the Range into the domain value.

When empty, the zero range value is returned. Otherwise a new range value is built from the issue level and the bounds.

func (Range) Empty

func (r Range) Empty() bool

Empty reports whether the Range is empty, i.e. the issue level and both bounds are unset.

type Strings

type Strings struct {
	// List stores the slice of exact string values
	// in its transport representation.
	List []string `yaml:"list,omitempty"`

	// Issue stores the transport representation
	// of the issue type level associated with the list of values.
	Issue Issue `yaml:"issue,omitempty"`
}

Strings is the transport representation of a string list config value, pairing a list of exact string values with the issue type level used to report violations of the list.

func (Strings) Config

func (s Strings) Config() value.Strings

Config converts the Strings into the domain value.

When empty, the zero strings value is returned. Otherwise a new strings value is built from the issue level and the list of values.

func (Strings) Empty

func (s Strings) Empty() bool

Empty reports whether the Strings is empty, i.e. neither the issue level nor the list of values is set.

Jump to

Keyboard shortcuts

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