edeh

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Example (SplitHeader)
sample := func(line string) {
	name, eno, body, err := splitHeader([]byte(line))
	if err == nil {
		fmt.Printf("%s:%d[%s]\n", name, eno, string(body))
	} else {
		fmt.Println(err)
	}
}

sample("-payload 1-")
sample("foo\t-payload 2-")
sample("bar:\t-payload 3-")
sample(":1\t-payload 4-")
sample("baz:1\t-payload 5-")
Output:

no event prefix in `line:-payload 1-`
foo:-1[-payload 2-]
strconv.Atoi: parsing "": invalid syntax
no filename in journal prefix of `line::1	-payload 4-`
baz:1[-payload 5-]

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Message added in v0.8.0

func Message(r watched.EventRecv, msg []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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