errors

package
v0.5.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errors contains error types definition and related functions used by the Liqonet package.

Index

Constants

View Source
const (
	// GreaterOrEqual used as reason of failure in WrongParameter error.
	GreaterOrEqual = ">="
	// MinorOrEqual used as reason of failure in WrongParameter error.
	MinorOrEqual = "<="
	// AtLeastOneValid used as reason of failure in WrongParameter error.
	AtLeastOneValid = "at least one of the arguments has to be valid"
	// ValidIP used as reason of failure in WrongParameter error.
	ValidIP = "a valid IP address"
	// NotNil used as reason of failure in WrongParameter error.
	NotNil = "not nil"
	// ValidCIDR used as reason of failure in WrongParameter error.
	ValidCIDR = "a valid network CIDR"
	// StringNotEmpty used as reason of failure in WrongParameter error.
	StringNotEmpty = "not empty"
	// Initialization used as reason of failure in WrongParameter error.
	Initialization = "initialized first"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MissingInit

type MissingInit struct {
	StructureName string
}

MissingInit is returned when a data structure is tried to be used before correct initialization.

func (*MissingInit) Error

func (sni *MissingInit) Error() string

func (*MissingInit) Is

func (sni *MissingInit) Is(target error) bool

Is function is used for assert that a generic error is a MissingInit error.

type NoRouteFound

type NoRouteFound struct {
	IPAddress string
}

NoRouteFound it is returned when no route is found for a given destination network.

func (*NoRouteFound) Error

func (nrf *NoRouteFound) Error() string

type ParseIPError

type ParseIPError struct {
	IPToBeParsed string
}

ParseIPError it is returned when net.ParseIP() fails to parse and ip address.

func (*ParseIPError) Error

func (pie *ParseIPError) Error() string

type WrongParameter

type WrongParameter struct {
	Argument  string
	Reason    string
	Parameter string
}

WrongParameter it is returned when parameters passed to a function are not correct.

func (*WrongParameter) Error

func (wp *WrongParameter) Error() string

Jump to

Keyboard shortcuts

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