common

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Facility = map[uint8]string{
	0:  "kernel messages",
	1:  "user-level messages",
	2:  "mail system messages",
	3:  "system daemons messages",
	4:  "authorization messages",
	5:  "messages generated internally by syslogd",
	6:  "line printer subsystem messages",
	7:  "network news subsystem messages",
	8:  "UUCP subsystem messages",
	9:  "clock daemon messages",
	10: "security/authorization messages",
	11: "ftp daemon messages",
	12: "NTP subsystem messages",
	13: "audit messages",
	14: "console messages",
	15: "clock daemon messages",
	16: "local use 0 (local0)",
	17: "local use 1 (local1)",
	18: "local use 2 (local2)",
	19: "local use 3 (local3)",
	20: "local use 4 (local4)",
	21: "local use 5 (local5)",
	22: "local use 6 (local6)",
	23: "local use 7 (local7)",
}

Facility maps facility numeric codes to facility string messages. As per RFC 5427.

View Source
var FacilityKeywords = map[uint8]string{
	0:  "kern",
	1:  "user",
	2:  "mail",
	3:  "daemon",
	4:  "auth",
	5:  "syslog",
	6:  "lpr",
	7:  "news",
	8:  "uucp",
	9:  "cron",
	10: "authpriv",
	11: "ftp",
	12: "ntp",
	13: "security",
	14: "console",
	15: "cron2",
	16: "local0",
	17: "local1",
	18: "local2",
	19: "local3",
	20: "local4",
	21: "local5",
	22: "local6",
	23: "local7",
}

FacilityKeywords maps facility numeric codes to facility keywords. As per RFC 5427.

View Source
var SeverityLevels = map[uint8]string{
	0: "emergency",
	1: "alert",
	2: "critical",
	3: "error",
	4: "warning",
	5: "notice",
	6: "informational",
	7: "debug",
}

SeverityLevels maps seveirty levels to severity string levels.

View Source
var SeverityLevelsShort = map[uint8]string{
	0: "emerg",
	1: "alert",
	2: "crit",
	3: "err",
	4: "warning",
	5: "notice",
	6: "info",
	7: "debug",
}

SeverityLevelsShort maps severity levels to severity short string levels as per https://github.com/torvalds/linux/blob/master/tools/include/linux/kern_levels.h and syslog(3).

View Source
var SeverityMessages = map[uint8]string{
	0: "system is unusable",
	1: "action must be taken immediately",
	2: "critical conditions",
	3: "error conditions",
	4: "warning conditions",
	5: "normal but significant condition",
	6: "informational messages",
	7: "debug-level messages",
}

SeverityMessages maps severity levels to severity string messages.

Functions

func EscapeBytes

func EscapeBytes(value string) string

EscapeBytes adds a backslash to \, ], " characters.

func InBetween

func InBetween(val, min, max int) bool

InBetween tells whether value is into [min, max] range.

func RemoveBytes

func RemoveBytes(data []byte, positions []int, offset int) []byte

RemoveBytes removes byte at given positions from data byte slice, starting from the given offset.

func UnsafeUTF8DecimalCodePointsToInt

func UnsafeUTF8DecimalCodePointsToInt(chars []uint8) int

UnsafeUTF8DecimalCodePointsToInt converts a slice containing a series of UTF-8 decimal code points into their integer rapresentation.

It assumes input code points are in the range 48-57. Returns a pointer since an empty slice is equal to nil and not to the zero value of the codomain (ie., `int`).

func ValidPriority

func ValidPriority(priority uint8) bool

ValidPriority checks whether the given value is in the priority range [0, 191].

func ValidVersion

func ValidVersion(version uint16) bool

ValidVersion checks whether the given value is in the version range [1, 999].

Types

This section is empty.

Jump to

Keyboard shortcuts

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