models

package
v0.0.0-...-5414e53 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

func NewDB

func NewDB(username string, password string, database string, hostname string, port string) (*DB, error)

Creates and return a new DB connection

func (*DB) AllStatistics

func (db *DB) AllStatistics() ([]*Statistic, error)

func (*DB) CreateRequest

func (db *DB) CreateRequest(r *FizzbuzzRequest) (*FizzbuzzRequest, error)

type Datastore

type Datastore interface {
	CreateRequest(r *FizzbuzzRequest) (*FizzbuzzRequest, error)
	AllStatistics() ([]*Statistic, error)
}

type FizzbuzzRequest

type FizzbuzzRequest struct {
	Id   int64  `json:"id,omitempty"`
	Int1 int    `json:"int1"`
	Int2 int    `json:"int2"`
	Str1 string `json:"str1"`
	Str2 string `json:"str2"`
}

type Statistic

type Statistic struct {
	Request *FizzbuzzRequest `json:"request"`
	Hits    int              `json:"hits"`
}

Jump to

Keyboard shortcuts

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