View README.md

Transport

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.

View README.md

NATS-RPC Generator

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

Usage

//go:generate nats-rpc -type=Service -client=client.go -cli=./cmd/cli/main.go
package main
View transport.go
package transport
import (
"errors"
"fmt"
"sync"
"time"
"github.com/golang/protobuf/proto"
"github.com/nats-io/go-nats"
View doc.md

Concept Dependence

Concept dependence is best understood using an example.

{
  "mrn": "001",
  "first_name": "John",
  "last_name": "Doe",
  "address": {
View keybase.md

Keybase proof

I hereby claim:

  • I am bruth on github.
  • I am byronruth (https://keybase.io/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:

View README.md

Postgres push triggers

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

Example

In the Postgres shell:

-- Create the functions
View add-docker-user.sh
#!/bin/bash
/usr/sbin/usermod -aG docker <user>
View README.md

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.
View diff_metadata.py
#!/usr/bin/env python
import os
import sys
import json
from cStringIO import StringIO
from django.core import management
def cmp_value(av, bv):
View gist:cf918798014e35d4d615
boot2docker down
boot2docker destroy
curl http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso > ~/.boot2docker/boot2docker.iso
boot2docker init
VBoxManage sharedfolder add boot2docker-vm -name home -hostpath /Users
boot2docker up
boot2docker ssh "sudo modprobe vboxsf && sudo mkdir -v -p /Users && sudo mount -v -t vboxsf -o uid=0,gid=0 home /Users"