testing

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 3 Imported by: 0

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