Skip to content

Instantly share code, notes, and snippets.

Byron Ruth bruth

Block or report user

Report or block bruth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View main.go
package main
import (
bruth / invoc_test.go
Created Oct 17, 2017
Method invocation benchmarks
View invoc_test.go
package main
import (
type myint int64
type Inccer interface {


This is a Go library that provides a thin, but opinionated abstraction over the go-nats API. The use case is for writing services that use NATS as a transport layer.

The NATS API expects a slice of bytes as the representation of a message. In general, it is often necessary to standardize on a serialization format to simplify designed and interacting with messages.

This library standardizes on Protocol Buffers as the message serialization format and it provides a few conveniences when working with Protobuf messages.

The two main value-add features this library provides are the Transport interface and implementation and the Message type.


NATS-RPC Generator

go generate command for creating a client interface, CLI, and serve function for a service interface.


//go:generate nats-rpc -type=Service -client=client.go -cli=./cmd/cli/main.go
package main
View transport.go
package transport
import (
bruth /
Last active Oct 12, 2016
Concept dependence

Concept Dependence

Concept dependence is best understood using an example.

  "mrn": "001",
  "first_name": "John",
  "last_name": "Doe",
  "address": {

Keybase proof

I hereby claim:

  • I am bruth on github.
  • I am byronruth ( on keybase.
  • I have a public key whose fingerprint is 2346 07EB 7539 D135 6581 63F7 C873 29F9 01B2 88C1

To claim this, I am signing this object:

bruth /
Last active Jul 31, 2019
Postgres push notification

Postgres push triggers

Watch a table for changes and push a notification with a payload describing the change.


In the Postgres shell:

-- Create the functions
bruth /
Last active Jun 22, 2018
Setup Official Docker Repo on RHEL 7
/usr/sbin/usermod -aG docker <user>
bruth /
Last active May 11, 2019
SQLite update hook example in Go

SQLite Update Hook Example

This is an example usage of registering an update_hook to a SQLite connection. The motivation for exploring this feature is to test out various implementations of data monitoring interfaces.

A few notable properties of the implementation:

  • The hook must be registered on the connection being used which requires clients to manually integrate this code.
  • Each INSERT and UPDATE operation requires a subsequent SELECT to get the row data.
  • When registering the hook, increasing the bufsize under heavy workloads will improve throughput, but the SQLite library is single-threaded by design.
You can’t perform that action at this time.