database

package
v0.0.0-...-c8b213a Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SelectAllMateosExpectedQuery = `` /* 464-byte string literal not displayed */

	SelectAllMateosLegacyExpectedQuery = `` /* 517-byte string literal not displayed */

)

Variables

View Source
var (
	TestJohn = model.Mateo{
		ID:            1,
		FirstName:     "John",
		LastName:      "Doe",
		Email:         "john.doe@example.com",
		TotalAttended: 5,
		TotalHosted:   2,
		GuestRatio:    2.5,
	}
	TestAdam = model.Mateo{
		ID:            2,
		FirstName:     "Adam",
		LastName:      "Samuel",
		Email:         "adam.samuel@example.com",
		TotalAttended: 4,
		TotalHosted:   2,
		GuestRatio:    2.0,
	}

	// Legacy
	TestBob = model.Mateo{
		ID:           3,
		FirstName:    "Bob",
		LastName:     "Jane",
		Email:        "bob.jane@example.com",
		LastHostDate: "12-05-19",
		Attended:     4,
	}
	TestDavid = model.Mateo{
		ID:           4,
		FirstName:    "David",
		LastName:     "Wilson",
		Email:        "david.wilson@example.com",
		LastHostDate: "01-06-19",
		Attended:     1,
	}
)

Functions

func GetMap

func GetMap(mateo model.Mateo, sort string) map[string]interface{}

func GetMockDB

func GetMockDB(t *testing.T) sqlmock.Sqlmock

func GetValues

func GetValues(mateo model.Mateo, sort string) []driver.Value

func InsertDinner

func InsertDinner(date time.Time, venue string, lastName string) (map[string]interface{}, error)

func InsertGuest

func InsertGuest(dinnerID int64, mateoID int64) error

func InsertGuests

func InsertGuests(dinnerID int64, lastNames []string) ([]string, error)

func InsertInvite

func InsertInvite(
	inviteID string,
	inviteType string,
	mateoID int64,
	dinnerID *int64,
	dinnerTime time.Time,
) (map[string]interface{}, error)

func InsertMessage

func InsertMessage(event string, mateoID int64) (map[string]interface{}, error)

func SelectAllDinners

func SelectAllDinners() ([]map[string]interface{}, error)

func SelectAllGuestsForDinner

func SelectAllGuestsForDinner(dinnerID int64) ([]string, error)

func SelectAllInvitesForDinner

func SelectAllInvitesForDinner(dinnerID int64) ([]map[string]interface{}, error)

func SelectAllMateos

func SelectAllMateos() ([]map[string]interface{}, error)

func SelectAllMateosExceptHost

func SelectAllMateosExceptHost(hostID int64) ([]map[string]interface{}, error)

func SelectAllMateosLegacy

func SelectAllMateosLegacy() ([]map[string]interface{}, error)

func SelectInviteByID

func SelectInviteByID(inviteID string) (map[string]interface{}, error)

func SelectLatestDinner

func SelectLatestDinner() (map[string]interface{}, error)

func SelectMateoByID

func SelectMateoByID(mateoID int64) (map[string]interface{}, error)

func SelectMateoByInviteID

func SelectMateoByInviteID(inviteID string) (map[string]interface{}, error)

func SelectMateoByLastName

func SelectMateoByLastName(lastName string) (map[string]interface{}, error)

func SelectRecentMessagesForMateoEvent

func SelectRecentMessagesForMateoEvent(event string, mateoID int64) ([]map[string]interface{}, error)

func UpdateDinnerVenue

func UpdateDinnerVenue(dinnerID int64, venue string) error

func UpdateInvite

func UpdateInvite(inviteID string, inviteStatus string) (map[string]interface{}, error)

Types

type Mock

type Mock struct {
	ExpectQuery   string
	ExpectColumns []string
	ExpectRows    []MockRow
	ExpectErr     error
}

type MockRow

type MockRow []driver.Value

Jump to

Keyboard shortcuts

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