Documentation ¶
Overview ¶
Package common is used for combining common functions from other packages which aren't connected with C language part
Index ¶
- Constants
- func GetDPDKLogLevel() string
- func GetDefaultCPUs(cpuNumber int) []int
- func HandleCPUList(s string, maxcpu int) ([]int, error)
- func LogDebug(logType LogType, v ...interface{})
- func LogDrop(logType LogType, v ...interface{})
- func LogError(logType LogType, v ...interface{}) string
- func LogFatal(logType LogType, v ...interface{})
- func LogFatalf(logType LogType, format string, v ...interface{})
- func LogTitle(logType LogType, v ...interface{})
- func LogWarning(logType LogType, v ...interface{})
- func SetLogType(logType LogType)
- func WrapWithNFError(err error, message string, code ErrorCode) error
- type ErrorCode
- type LogType
- type NFError
- type RXTXStats
Constants ¶
const ( // No - no output even after fatal errors No LogType = 1 << iota // Initialization - output during system initialization Initialization = 2 // Debug - output during execution one time per time period (scheduler ticks) Debug = 4 // Verbose - output during execution as soon as something happens. Can influence performance Verbose = 8 )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultCPUs ¶
GetDefaultCPUs returns default core list {0, 1, ..., NumCPU}
func HandleCPUList ¶
HandleCPUs parses cpu list string into array of valid core numbers. Removes duplicates
func LogDebug ¶
func LogDebug(logType LogType, v ...interface{})
LogDebug internal, used in all packages
func LogDrop ¶
func LogDrop(logType LogType, v ...interface{})
LogDrop internal, used in all packages
func LogFatal ¶
func LogFatal(logType LogType, v ...interface{})
LogFatal internal, used in all packages
func LogTitle ¶
func LogTitle(logType LogType, v ...interface{})
LogTitle internal, used in all packages
func LogWarning ¶
func LogWarning(logType LogType, v ...interface{})
LogWarning internal, used in all packages
Types ¶
type ErrorCode ¶
type ErrorCode int
ErrorCode type for codes of errors
const ( Fail ErrorCode ParseCPUListErr ReqTooManyPorts BadArgument UseNilFlowErr UseClosedFlowErr OpenedFlowAtTheEnd PortHasNoQueues NotAllQueuesUsed FailToInitPort ParseRuleJSONErr FileErr ParseRuleErr IncorrectArgInRules IncorrectRule AllocMbufErr PktMbufHeadRoomTooSmall NotEnoughCores CreatePortErr MaxCPUExceedErr PcapReadFail PcapWriteFail InvalidCPURangeErr SetAffinityErr MultipleReceivePort MultipleKNIPort WrongPort FailToInitDPDK FailToCreateKNI FailToReleaseKNI BadSocket )
constants with error codes
func GetNFErrorCode ¶
GetNFErrorCode returns value of cCode field if err is NFError or pointer to it and -1 otherwise.
type NFError ¶
NFError is error type returned by nff-go functions
func GetNFError ¶
GetNFError if error is NFerror or pointer to int returns pointer to NFError, otherwise returns nil.
func (*NFError) Cause ¶
Cause returns the underlying cause of error, if possible. If not, returns err itself.