storage

package
v0.0.0-...-1b9f703 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnString

type ConnString struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
}

type ContextKey

type ContextKey int
const ContextKeyDB ContextKey = iota + 1

type DB

type DB interface {
	GetPhonesByEmailPrefix(ctx context.Context, prefix string) ([]*FoundPhone, error)
	Close()
}

func NewDB

func NewDB(connStr *ConnString) (DB, error)

type Employee

type Employee struct {
	ID         int       `gorm:"column:id"`
	FirstName  string    `gorm:"column:first_name"`
	LastName   string    `gorm:"column:last_name"`
	Salary     string    `gorm:"column:salary"`
	ManagerID  int       `gorm:"column:manager_id"`
	Department int       `gorm:"column:department"`
	Position   int       `gorm:"column:position"`
	EntryAt    time.Time `gorm:"column:entry_at"`
	Phone      string    `gorm:"column:phone"`
	Email      string    `gorm:"column:email"`
}

type FoundPhone

type FoundPhone struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Phone     string `phone:"phone"`
	Email     string `email:"email"`
}

Jump to

Keyboard shortcuts

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