datastore

package
v0.0.0-...-85596be Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Host     string
	Port     int
	User     string
	Password string
	DBname   string
}

type Datastore

type Datastore interface {
	Connect(*Connection) error
	Write(*Record)
}

Datastore abstraction

type Postgres

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

Postgres struct implements Datastore interface

func (*Postgres) Connect

func (p *Postgres) Connect(config *Connection) error

Connect to a postgres database and create

func (*Postgres) Write

func (p *Postgres) Write(r *Record)

Write a requests execution data to a new row

type Record

type Record struct {
	Success    bool
	Title      string
	StatusCode int
	Duration   time.Duration
}

Row of data to write to the database table

Jump to

Keyboard shortcuts

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