5
5
6
6
The Signal Sciences module in Golang allows for integrating your Golang
7
7
application directly with the Signal Sciences agent at the source code
8
- level. It is written as an ` http.Handler ` wrapper. To
8
+ level. It is written as a ` http.Handler ` wrapper. To
9
9
integrate your application with the module, you will need to wrap your
10
10
existing handler with the module handler.
11
11
@@ -14,7 +14,7 @@ existing handler with the module handler.
14
14
15
15
## Example Code Snippet
16
16
``` go
17
- // Existing http.Handler
17
+ // Example existing http.Handler
18
18
mux := http.NewServeMux ()
19
19
mux.HandleFunc (" /" , helloworld)
20
20
@@ -44,21 +44,24 @@ log.Fatal(s.ListenAndServe())
44
44
45
45
## Examples
46
46
47
- The [ examples] ( examples/ ) directory contains complete example code.
47
+ The [ examples/helloworld ] ( examples/helloworld ) directory contains complete example code.
48
48
49
49
To run the simple [ helloworld] ( examples/helloworld/main.go ) example:
50
50
``` shell
51
- # Run __without__ sigsci enabled
51
+ # Syntax:
52
+ # go run ./examples/helloworld <listener-address:port> [<sigsci-agent-rpc-address>]
53
+ #
54
+ # Run WITHOUT sigsci enabled
52
55
go run ./examples/helloworld localhost:8000
53
- # Run with sigsci-agent listening via a UNIX Domain socket file
56
+ # Run WITH sigsci-agent listening via a UNIX Domain socket file
54
57
go run ./examples/helloworld localhost:8000 /var/run/sigsci.sock
55
- # Run with sigsci-agent listening via a TCP address:port
58
+ # Run WITH sigsci-agent listening via a TCP address:port
56
59
go run ./examples/helloworld localhost:8000 localhost:9999
57
60
```
58
61
59
- This will run a HTTP listener on ` localhost:8000 ` , which will send any
62
+ The above will run a HTTP listener on ` localhost:8000 ` , which will send any
60
63
traffic to this listener to a running sigsci-agent for inspection (if
61
- configured).
64
+ an agent address is configured).
62
65
63
66
[ doc-img ] : https://godoc.org/github.com/signalsciences/sigsci-module-golang?status.svg
64
67
[ doc ] : https://godoc.org/github.com/signalsciences/sigsci-module-golang
0 commit comments