db

package
v0.0.0-...-33dbce9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOST = "kalpitcool2006-gmailcom_my-postgres_1"
	PORT = 5432
)

Variables

View Source
var ErrNoMatch = fmt.Errorf("no matching record")

ErrNoMatch is returned when we request a row that doesn't exist

Functions

func GetDatabaseProvider

func GetDatabaseProvider(username, password, database string) (*sql.DB, error)

func NewDatabaseRepository

func NewDatabaseRepository(db *sql.DB) repository.DatabaseRepository

NewRepository returns instance of Database repository

Types

type Database

type Database struct {
	Conn *sql.DB
}

type DatabaseImpl

type DatabaseImpl struct {
	Conn *sql.DB
}

func (*DatabaseImpl) CreateEvents

func (db *DatabaseImpl) CreateEvents(ctx context.Context, req models.Event) (eventResp models.Event, err error)

CreateEvents implements repository.DatabaseRepository

func (*DatabaseImpl) GetAllEvents

func (db *DatabaseImpl) GetAllEvents(ctx context.Context) (eventList models.EventList, err error)

GetAllEvents implements repository.DatabaseRepository

Jump to

Keyboard shortcuts

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