validation

package
v1.18.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 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 AppendListenerError

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

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 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

func GetListenerErr added in v1.0.0

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

func GetListenerError added in v1.16.5

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

func GetListenerWarning added in v1.15.31

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

func GetProxyError

func GetProxyError(proxyRpt *validation.ProxyReport) error

func GetProxyWarning added in v0.20.2

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

func GetRouteErr added in v1.0.0

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

func GetRouteWarning added in v1.0.0

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

func GetTcpHostErr added in v1.0.0

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

func GetTcpHostWarning added in v1.14.12

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

Extract, format and return all warnings on this TcpHost instance as a list of strings

func GetTcpListenerErr added in v1.0.0

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

func GetVirtualHostErr added in v1.0.0

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

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