View main.go
package main
import (
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 (

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:


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
/usr/sbin/usermod -aG docker <user>

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.