p4broker-reader

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 3 Imported by: 0

README

A reader for the Perforce/helix broker filter output.

For example if you have a p4broker.conf stanza like so:

command: access
{
    action=filter;
    execute=/path/to/go/program;
}

You can use this p4broker-reader.Read() within the receiving go program to get the output dictionary as a map[string]string.

And example dictionary is like so:

brokerListenPort: 1998
brokerTargetPort: localhost:1999
command: access
clientProg: p4
clientVersion: 2020.2/LINUX26X86_64/2057778
clientProtocol: 89
apiProtocol: 99999
workspace: NP-B-BATES
user: brett.bates
clientIp: 127.0.0.1
clientHost: ahost
cwd: /home/brett/scratch/broker
clientPort: 1998
argCount: 2
Arg0: read
Arg1: //path/to/file

Example usage:

// Pass in an io.Reader, though you probably want os.Stdin to get input from p4broker
res, err := Read(os.Stdin)
if err != nil {
	log.Fatalf("%v", err)
}
log.Printf("%v", res["Arg0"])

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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