Help us shape the future of Go! Take the 2026 Go Developer Survey

validation

package
v1.19.26 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ErrorLevels_WARNING string = "WARNING"
	ErrorLevels_ERROR   string = "ERROR"
)

Variables

View Source
var (
	RouteErrorMsg      = "Route Error"
	RouteIdentifierTxt = "Route Name"
)

Functions

func AppendHTTPListenerError

func AppendHTTPListenerError(httpListenerReport *validation.HttpListenerReport, errType validation.HttpListenerReport_Error_Type, reason string)

func AppendHTTPListenerErrorWithMetadata added in v1.19.0

func AppendHTTPListenerErrorWithMetadata(
	httpListenerReport *validation.HttpListenerReport,
	errType validation.HttpListenerReport_Error_Type,
	reason string,
	metadata *v1.SourceMetadata)

func AppendHTTPListenerWarning added in v1.17.17

func AppendHTTPListenerWarning(httpListenerReport *validation.HttpListenerReport, errType validation.HttpListenerReport_Warning_Type, reason string)

func AppendListenerError

func AppendListenerError(listenerReport *validation.ListenerReport, errType validation.ListenerReport_Error_Type, reason string)

func AppendListenerErrorWithMetadata added in v1.19.0

func AppendListenerErrorWithMetadata(listenerReport *validation.ListenerReport, errType validation.ListenerReport_Error_Type, reason string, metadata *v1.SourceMetadata)

func AppendListenerWarning added in v1.15.31

func AppendListenerWarning(listenerReport *validation.ListenerReport, errType validation.ListenerReport_Warning_Type, reason string)

func AppendRouteError

func AppendRouteError(routeReport *validation.RouteReport, errType validation.RouteReport_Error_Type, reason string, routeName string)

func AppendRouteErrorWithMetadata added in v1.17.0

func AppendRouteErrorWithMetadata(routeReport *validation.RouteReport, errType validation.RouteReport_Error_Type, reason string, routeName string, metadata *v1.SourceMetadata)

func AppendRouteWarning added in v0.20.2

func AppendRouteWarning(routeReport *validation.RouteReport, errType validation.RouteReport_Warning_Type, reason string)

func AppendTCPListenerError added in v1.9.25

func AppendTCPListenerError(tcpListenerReport *validation.TcpListenerReport, errType validation.TcpListenerReport_Error_Type, reason string)

func AppendTCPListenerWarning added in v1.17.17

func AppendTCPListenerWarning(httpListenerReport *validation.TcpListenerReport, errType validation.TcpListenerReport_Warning_Type, reason string)

func AppendTcpHostWarning added in v1.14.12

func AppendTcpHostWarning(tcpHostReport *validation.TcpHostReport, errType validation.TcpHostReport_Warning_Type, reason string)

func AppendVirtualHostError

func AppendVirtualHostError(virtualHostReport *validation.VirtualHostReport, errType validation.VirtualHostReport_Error_Type, reason string)

func AppendVirtualHostErrorWithMetadata added in v1.17.0

func AppendVirtualHostErrorWithMetadata(virtualHostReport *validation.VirtualHostReport, errType validation.VirtualHostReport_Error_Type, reason string, metadata *v1.SourceMetadata)

func GetHttpListenerErr added in v1.0.0

func GetHttpListenerErr(httpListener *validation.HttpListenerReport) []error

GetHttpListenerErr returns the formatted errors on the HttpListenerReport only. It does NOT recursively aggregate errors in its sub-reports such as VirtualHostReports, RouteReports, etc.

func GetHttpListenerWarning added in v1.17.17

func GetHttpListenerWarning(httpListener *validation.HttpListenerReport) []string

GetHttpListenerWarning returns the formatted warnings on the HttpListenerReport only. It does NOT recursively aggregate warnings in its sub-reports such as VirtualHostReports, RouteReports, etc.

func GetListenerErr added in v1.0.0

func GetListenerErr(listener *validation.ListenerReport) []error

GetListenerErr returns the formatted errors on the ListenerReport only. It does NOT recursively aggregate errors in its sub-reports such as its host report, route report, etc.

func GetListenerError added in v1.16.5

func GetListenerError(listener *validation.ListenerReport) []error

GetListenerError returns the aggregated errors on the ListenerReport. Based on the type of listener, it aggregates the errors in its sub-reports such as its host report, route report, etc.

func GetListenerWarn added in v1.17.17

func GetListenerWarn(listener *validation.ListenerReport) []string

GetListenerWarn returns the formatted warnings on the ListenerReport only. It does NOT recursively aggregate errors in its sub-reports such as its host report, route report, etc.

func GetListenerWarning added in v1.15.31

func GetListenerWarning(listener *validation.ListenerReport) []string

GetListenerWarning returns the aggregated warnings on the ListenerReport. Based on the type of listener, it aggregates the warnings in its sub-reports such as its host report, route report, etc.

func GetProxyError

func GetProxyError(proxyRpt *validation.ProxyReport) error

GetProxyError returns the aggregated errors on the ProxyReport. It iterates through the listeners and based on the type of listener, it aggregates the errors in its sub-reports such as its host report, route report, etc.

func GetProxyWarning added in v0.20.2

func GetProxyWarning(proxyRpt *validation.ProxyReport) []string

GetProxyWarning returns the aggregated warnings on the ProxyReport. It iterates through the listeners and based on the type of listener, it aggregates the warnings in its sub-reports such as its host report, route report, etc.

func GetRouteErr added in v1.0.0

func GetRouteErr(route *validation.RouteReport) []error

GetRouteErr returns the formatted errors on the RouteReport.

func GetRouteWarning added in v1.0.0

func GetRouteWarning(route *validation.RouteReport) []string

GetRouteWarning returns the formatted warnings on the RouteReport.

func GetTcpHostErr added in v1.0.0

func GetTcpHostErr(tcpHost *validation.TcpHostReport) []error

GetTcpHostErr returns the formatted errors on the TcpHostReport.

func GetTcpHostWarning added in v1.14.12

func GetTcpHostWarning(tcpHost *validation.TcpHostReport) []string

GetTcpHostWarning returns the formatted warnings on the TcpHostReport.

func GetTcpListenerErr added in v1.0.0

func GetTcpListenerErr(tcpListener *validation.TcpListenerReport) []error

GetTcpListenerErr returns the formatted errors on the TcpListenerReport only. It does NOT recursively aggregate errors in its sub-reports such as TcpHostReports, etc.

func GetTcpListenerWarning added in v1.17.17

func GetTcpListenerWarning(tcpListener *validation.TcpListenerReport) []string

GetTcpListenerWarning returns the formatted warnings on the TcpListenerReport only. It does NOT recursively aggregate warnings in its sub-reports such as TcpHostReports, etc.

func GetVirtualHostErr added in v1.0.0

func GetVirtualHostErr(virtualHost *validation.VirtualHostReport) []error

GetVirtualHostErr returns the formatted errors on the VirtualHostReport only. It does NOT recursively aggregate errors in its sub-reports such as Routes, etc.

func MakeReport

func MakeReport(proxy *v1.Proxy) *validation.ProxyReport

Types

type ErrorLevelContext added in v1.14.12

type ErrorLevelContext struct {
	// A given TCP listener can have multiple TCP hosts; HostNum provides the
	// numerical index of the host on the listener associated with the error to
	// be reported
	HostNum *int
}

ErrorLevelContext carries additional information to be passed in the ErrorWithKnownLevel object

type ErrorWithKnownLevel added in v1.14.12

type ErrorWithKnownLevel interface {
	error
	// The severity of the error - should return either ErrorLevels_WARNING or
	// ErrorLevels_ERROR
	ErrorLevel() string
	// Additional contextual information required to report the error/warning
	GetContext() ErrorLevelContext
	// The instance of the error itself
	GetError() error
}

Types implementing ErrorWithKnownLevel are able to report on the severity of the error they describe by evaluating ErrorLevel()

type TcpHostWarning added in v1.14.12

type TcpHostWarning struct {
	Err      error
	ErrLevel string
	Context  ErrorLevelContext
}

TcpHostWarning implements ErrorWithKnownLevel; it is intended to allow reporting certain errors as warnings and others as errors, and provides the necessary context required for reporting errors as such

func (*TcpHostWarning) Error added in v1.14.12

func (tcpHostWarning *TcpHostWarning) Error() string

func (*TcpHostWarning) ErrorLevel added in v1.14.12

func (tcpHostWarning *TcpHostWarning) ErrorLevel() string

func (*TcpHostWarning) GetContext added in v1.14.12

func (tcpHostWarning *TcpHostWarning) GetContext() ErrorLevelContext

func (*TcpHostWarning) GetError added in v1.14.12

func (tcpHostWarning *TcpHostWarning) GetError() error

return the instance of the Error this object is wrapping

Jump to

Keyboard shortcuts

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