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 (
"flag"
"fmt"
"log"
"math/rand"
"os"
"os/signal"
"sync"
@bruth
bruth / invoc_test.go
Created Oct 17, 2017
Method invocation benchmarks
View invoc_test.go
package main
import (
"reflect"
"testing"
)
type myint int64
type Inccer interface {
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"
@bruth
bruth / doc.md
Last active Oct 12, 2016
Concept dependence
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:

@bruth
bruth / README.md
Last active Jul 31, 2019
Postgres push notification
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
@bruth
bruth / add-docker-user.sh
Last active Jun 22, 2018
Setup Official Docker Repo on RHEL 7
View add-docker-user.sh
#!/bin/bash
/usr/sbin/usermod -aG docker <user>
@bruth
bruth / README.md
Last active May 11, 2019
SQLite update hook example in Go
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.
You can’t perform that action at this time.