xesite/vendor/github.com/Xe/gopreload
Cadey Ratio 6197f455f6 vgo 2018-07-01 20:38:18 +00:00
..
.gitignore convert to go buildpack 2017-12-13 11:42:37 -08:00
LICENSE convert to go buildpack 2017-12-13 11:42:37 -08:00
README.md convert to go buildpack 2017-12-13 11:42:37 -08:00
doc.go Add gopreload as a dependency 2017-03-25 11:01:39 -07:00
preload.go Add gopreload as a dependency 2017-03-25 11:01:39 -07:00

README.md

gopreload

An emulation of the linux libc LD_PRELOAD except for use with Go plugins for the addition of instrumentation and debugging utilities.

Pluginizer

pluginizer is a bit of glue that makes it easier to turn underscore imports into plugins:

$ go get github.com/Xe/gopreload/cmd/pluginizer
$ pluginizer -help
Usage of pluginizer:
  -dest string
        destination package to generate
  -pkg string
        package to underscore import
$ pluginizer -pkg github.com/lib/pq -dest github.com/Xe/gopreload/database/postgres
To build this plugin:
  $ go build -buildmode plugin -o /path/to/output.so github.com/Xe/gopreload/database/postgres

Database drivers

I have included plugin boilerplate autogenned versions of the sqlite, postgres and mysql database drivers.

Manhole

manhole is an example of debugging and introspection tooling that has been useful when debugging past issues with long-running server processes.

Security Implications

This package assumes that programs run using it are never started with environment variables that are set by unauthenticated users. Any errors in loading the plugins will be logged using the standard library logger log and ignored.

This has about the same security implications as LD_PRELOAD does in most Linux distributions, but the risk is minimal compared to the massive benefit for being able to have arbitrary background services all be able to be dug into using the same tooling or being able to have metric submission be completely separated from the backend metric creation. Common logging setup processes can be always loaded, making the default logger settings into the correct settings.