repository

package
v0.0.0-...-f6567f3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: GPL-3.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbConnection *sql.DB

DbConnection - Database Connectin Pool

Functions

func CloseRepo

func CloseRepo()

CloseRepo - close database connections

func SetupRepo

func SetupRepo() (err error)

SetupRepo - setup database connections

Types

type BookRepo

type BookRepo struct {
	Name string
}

BookRepo - Book repository

func GetBookRepository

func GetBookRepository() BookRepo

GetBookRepository - returns book repository

func (BookRepo) Insert

func (repo BookRepo) Insert(doc interface{}) (int64, error)

Insert - Insert books to db

func (BookRepo) Remove

func (repo BookRepo) Remove(doc interface{}) (int64, error)

Remove - Delete books from db

func (BookRepo) Select

func (repo BookRepo) Select() (*list.List, error)

Select - Select books from db

func (BookRepo) Update

func (repo BookRepo) Update(doc interface{}) (int64, error)

Update - Update books

type Repo

type Repo interface {
	Select(doc interface{}) (*list.List, error)
	Insert(doc interface{}) (int64, error)
	Update(doc interface{}) (int64, error)
	Remove(doc interface{}) (int64, error)
}

Repo - abstract repository interface

type StudentRepo

type StudentRepo struct {
	Name string
}

StudentRepo - Student repository

func GetStudentRepository

func GetStudentRepository() StudentRepo

GetStudentRepository - returns student repository

func (StudentRepo) Insert

func (repo StudentRepo) Insert(doc interface{}) (int64, error)

Insert - Insert Student to db

func (StudentRepo) Remove

func (repo StudentRepo) Remove(doc interface{}) (int64, error)

Remove - Delete student from db

func (StudentRepo) Select

func (repo StudentRepo) Select() (*list.List, error)

Select - Select students from db

func (StudentRepo) Update

func (repo StudentRepo) Update(doc interface{}) (int64, error)

Update - Update student

Jump to

Keyboard shortcuts

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