validatedoc

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package validatedoc checks one CTIS document the way a strict receiver does: it decodes with unknown members refused, requires a version this module implements, and runs Report.Validate. It does no I/O and fetches nothing.

Index

Constants

View Source
const (
	CategoryDecode   = "decode"   // not JSON, or members the Go types do not know
	CategoryVersion  = "version"  // version missing or not implemented here
	CategoryValidate = "validate" // Report.Validate refused it
)

Problem categories.

Variables

This section is empty.

Functions

This section is empty.

Types

type Problem

type Problem struct {
	Category string `json:"category"`
	Message  string `json:"message"`
}

Problem says why a document is invalid.

func Check

func Check(raw []byte) *Problem

Check returns nil when raw is a valid CTIS report, else the first problem found, in the order version, decode, validate. The version comes first so a document of another major (a 1.x document) is reported as such, with the upgrade it needs, rather than as a list of unknown members.

func (*Problem) Error

func (p *Problem) Error() string

Jump to

Keyboard shortcuts

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