models

package
v0.0.0-...-5edbed4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(host string, database string, user string, pass string) (db *gorm.DB, err error)

Connect connect to the postgresql

func GetDb

func GetDb() *gorm.DB

GetDb return the db instance

func InitDB

func InitDB() (db *gorm.DB, e error)

InitDB init DB

Types

type Error

type Error struct {
	Error string `json:"error"`
	Code  int    `json:"code"`
}

Error is struct for error

type HTTPError

type HTTPError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

HTTPError is struct for HTTPError

type PageResponse

type PageResponse struct {
	Total    string      `json:"total"`
	Page     string      `json:"page"`
	PageSize string      `json:"pageSize"`
	Data     interface{} `json:"data"`
}

PageResponse response paged response

Jump to

Keyboard shortcuts

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