pgrecorder

package
v0.0.0-...-7ac24f4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CURRENT_EVENT_VERSION = 1
View Source
const DB_NAME = "postgres"
View Source
const DB_PASS = "squish-words-together-fun"
View Source
const DB_PORT = "5432"
View Source
const DB_URL = "porteventstore.crg0dcdtyinh.us-west-1.rds.amazonaws.com"

NOTE in a real app you'd put these in env

View Source
const DB_USER = "portman"
View Source
const EVENTSTORE = "events" // the event table

Variables

This section is empty.

Functions

This section is empty.

Types

type PGRecorder

type PGRecorder interface {
	Exec(string, ...interface{}) (sql.Result, error)
}

Executable implementations expose Exec with the same args as sql.DB.Exec

type PackingRecorder

type PackingRecorder struct {
	// contains filtered or unexported fields
}

func NewPackingRecorder

func NewPackingRecorder(db PGRecorder) *PackingRecorder

func (*PackingRecorder) Record

func (r *PackingRecorder) Record(e string, p *packing.Port) error

type Port

type Port struct {
	Maker  string `json:"maker"`
	First  string `json:"first"`
	Second string `json:"second"`
	Result string `json:"result"`
	Algo   string `json:"algo"` // "rando" || "carrollian"
}

Port is the repository representation of a portmanteau. It must implement the sql.driver.valuer in order to be marshal-able

func NewPort

func NewPort(p *packing.Port) *Port

func (*Port) Value

func (p *Port) Value() (driver.Value, error)

Value allows the Port to implement driver.Value, thus able to be marshaled by the sql driver

Jump to

Keyboard shortcuts

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