Brijesh's Git Server — aegis @ 60578df256b067f0282c007af24a3343eb7461bb

Successor to whodis

internal/database/service.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
package database

import (
	"database/sql"
	"time"
)

type Developer struct {
	ID        string
	Name      string
	Email     string
	CreatedAt time.Time
}

type Service interface {
	Health() map[string]string
	Close() error
	RunMigrations() error

	CreateDeveloper(name, email string) (string, error)
	GetDeveloper(id string) (*Developer, error)
	UpdateDeveloper(id, name, email string) error
	DeleteDeveloper(id string) error
}

type service struct {
	db *sql.DB
}