testing

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: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// MaxPriority contains the maximum priority value that a RFC5424 syslog message can have.
	MaxPriority = uint8(191)
	// MaxVersion contains the maximum version value that a RFC5424 syslog message can have.
	MaxVersion = uint16(999)
	// MaxRFC3339MicroTimestamp contains the maximum length RFC3339MICRO timestamp that a RFC5424 syslog message can have.
	MaxRFC3339MicroTimestamp = "2018-12-31T23:59:59.999999-23:59"
)

Variables

View Source
var (
	// MaxHostname is a maximum length hostname that a RFC5424 syslog message can have.
	MaxHostname = RandomBytes(255)
	// MaxAppname is a maximum length app-name that a RFC5424 syslog message can have.
	MaxAppname = RandomBytes(48)
	// MaxProcID is a maximum length app-name that a RFC5424 syslog message can have.
	MaxProcID = RandomBytes(128)
	// MaxMsgID is a maximum length app-name that a RFC5424 syslog message can have.
	MaxMsgID = RandomBytes(32)
	// MaxMessage is a maximum length message that a RFC5424 syslog message can contain when all other fields are at their maximum length.
	MaxMessage = RandomBytes(7681)
)

Functions

func RandomBytes

func RandomBytes(n int) []byte

RandomBytes returns a random byte slice with length n.

func RightPad

func RightPad(str string, limit int) string

RightPad pads a string with spaces until the given limit, or it cuts the string to the given limit.

func StringAddress

func StringAddress(str string) *string

StringAddress returns the address of the input string.

func TimeParse

func TimeParse(layout, value string) *time.Time

TimeParse parses a time string, for the given layout, into a pointer to a time.Time instance.

func Uint8Address

func Uint8Address(x uint8) *uint8

Uint8Address returns the address of the input uint8.

func YearTime

func YearTime(mm, dd, hh, min, ss int) time.Time

YearTime returns a time.Time of the given month, day, hour, minutes, and seconds for the current year (in UTC).

Types

This section is empty.

Jump to

Keyboard shortcuts

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