db

package
v0.0.0-...-aeac055 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package db contains anything related to database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conn

func Conn() *sql.DB

Conn create a new connection

Types

type Account

type Account struct {
	Name     string
	Account  string
	Password string
}

Account account information

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo database connection

func NewRepo

func NewRepo(conn *sql.DB) *Repo

NewRepo create a new repository interface.

func (*Repo) FindAccountByName

func (r *Repo) FindAccountByName(name string) (*Account, error)

FindAccountByName retrieve row by name

func (*Repo) InitDB

func (r *Repo) InitDB()

InitDB initialize database

func (*Repo) Save

func (r *Repo) Save(account *Account)

Save save account

Jump to

Keyboard shortcuts

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