validate

package
v0.1.54 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const WordWithDotHyphenUnder80Pattern = string(`^[a-zA-Z\d]$|^[a-zA-Z\d][\w\-.]{0,78}\w$`)

WordWithDotHyphenUnder80Pattern is a regexp pattern that matches string that contain alphanumerics, underscores, periods, and hyphens that start with alphanumeric and End alphanumeric or underscore. Limits size to 1-80. Based on https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules

Variables

This section is empty.

Functions

func LogInternalError

func LogInternalError(format string, a ...any)

Types

type Line

type Line struct {
	LineNumber int
	Content    string
}

func ReadLines

func ReadLines(sourceRange hcl.Range, bytes []byte) ([]Line, error)

func ReadLinesForRange

func ReadLinesForRange(sourceRange hcl.Range) ([]Line, error)

func (Line) String

func (l Line) String() string

type ResourceValidationInfo

type ResourceValidationInfo struct {
	SourceRanges  map[string]hcl.Range
	BlockDefRange hcl.Range
	ResourceId    string
}

type ValidationError

type ValidationError struct {
	ErrorMessage string
	ResourceId   string
	FieldName    string

	ResourceNotFound   bool
	ResourceNotFoundId string
}

Jump to

Keyboard shortcuts

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