gopreload

package module
v0.0.0-...-a00a8be Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2017 License: MIT Imports: 4 Imported by: 2

README

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.


Documentation

Overview

Package gopreload is a bit of a hack to emulate the behavior of LD_PRELOAD ld-preload. This allows you to have automatically starting instrumentation, etc.

Directories

Path Synopsis
cmd
database

Jump to

Keyboard shortcuts

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