go-syslog: github.com/influxdata/go-syslog/testing Index | Files

package testing

import "github.com/influxdata/go-syslog/testing"

Index

Package Files

testing.go

Constants

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

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)
)

func RandomBytes Uses

func RandomBytes(n int) []byte

RandomBytes returns a random byte slice with length n.

func RightPad Uses

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 Uses

func StringAddress(str string) *string

StringAddress returns the address of the input string.

func TimeParse Uses

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 Uses

func Uint8Address(x uint8) *uint8

Uint8Address returns the address of the input uint8.

func YearTime Uses

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).

Package testing imports 3 packages (graph). Updated 2019-05-01. Refresh now. Tools for package owners.