event

package
v0.0.0-...-80abe43 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB(db *sql.DB) error

CreateDB creates the events table if it does not yet exist

Types

type Database

type Database interface {
	// contains filtered or unexported methods
}

Database is an interface for retrieving Events

type Event

type Event struct {
	ID                uuid.UUID `json:"id"`
	EventType         string    `json:"event_type"`
	Context           string    `json:"context"`
	OriginalAccountID uuid.UUID `json:"original_account_id"`
	Data              string    `json:"payload"`
	CreatedAt         time.Time `json:"timestamp"`
}

type Handler

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

func NewHandler

func NewHandler() *Handler

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request, p httprouter.Params)

Create constructs a new event from the data in the POST body

func (*Handler) Index

Index returns a JSON array of all events

func (*Handler) Show

Show returns the data for a specific event as JSON

type PgDatabase

type PgDatabase struct{}

PgDatabase is a structure that implements the Database interface and interacts with Postgres db

Jump to

Keyboard shortcuts

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