error

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 2 Imported by: ? 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 error implements generic tooling for tracking RFC 2119 violations and linking back to the appropriate specification section.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// Level represents the RFC 2119 compliance level.
	Level Level

	// Reference is a URL for the violated specification requirement.
	Reference string

	// Err holds additional details about the violation.
	Err error
}

Error represents an error with compliance level and specification reference.

func (*Error) Error

func (err *Error) Error() string

Error returns the error message with specification reference.

type Level

type Level int

Level represents the RFC 2119 compliance levels

const (

	// May represents 'MAY' in RFC 2119.
	May Level = iota
	// Optional represents 'OPTIONAL' in RFC 2119.
	Optional

	// Should represents 'SHOULD' in RFC 2119.
	Should
	// ShouldNot represents 'SHOULD NOT' in RFC 2119.
	ShouldNot
	// Recommended represents 'RECOMMENDED' in RFC 2119.
	Recommended
	// NotRecommended represents 'NOT RECOMMENDED' in RFC 2119.
	NotRecommended

	// Must represents 'MUST' in RFC 2119
	Must
	// MustNot represents 'MUST NOT' in RFC 2119.
	MustNot
	// Shall represents 'SHALL' in RFC 2119.
	Shall
	// ShallNot represents 'SHALL NOT' in RFC 2119.
	ShallNot
	// Required represents 'REQUIRED' in RFC 2119.
	Required
)

func ParseLevel

func ParseLevel(level string) (Level, error)

ParseLevel takes a string level and returns the RFC 2119 compliance level constant.

Jump to

Keyboard shortcuts

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