models

package
v0.0.0-...-427d44f Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetDB *gorm.DB // connection about DB
)

Functions

func Connect

func Connect()

func DeleteGPS

func DeleteGPS(w http.ResponseWriter, r *http.Request) (string, error)

DeleteGPS function for delete one data in table gps

func DeleteUserPanel

func DeleteUserPanel(w http.ResponseWriter, r *http.Request) (string, error)

DeleteUserPanel function for delete one data in table users

func InsertGPS

func InsertGPS(w http.ResponseWriter, r *http.Request) (map[string]interface{}, error)

InsertGPS function for insert data in table GPS

func LimitOffset

func LimitOffset(limit string, offset string) string

func ReturnDBGorm

func ReturnDBGorm() *gorm.DB

func ShortBy

func ShortBy(query string) string

func UpdateGPS

func UpdateGPS(w http.ResponseWriter, r *http.Request) (map[string]interface{}, error)

UpdateGPS function for update data gps

func UpdateUserPanel

func UpdateUserPanel(w http.ResponseWriter, r *http.Request) (map[string]interface{}, error)

UpdateUserPanel function for update data users

Types

type Gps

type Gps struct {
	Brand       string `json:"brand,omitemp"`
	Models      string `json:"models,omitemp"`
	Name        string `json:"name,omitemp"`
	Waranty     string `json:"waranty,omitemp"`
	DateBuy     string `json:"date_buy,omitemp"`
	DateSold    string `json:"date_sold,omitemp"`
	SoldTo      string `json:"sold_to,omitemp"`
	Foto        string `json:"foto,omitemp"`
	Description string `json:"description,omitemp"`
	gorm.Model
}

struct GPS

func GetAllGPS

func GetAllGPS(w http.ResponseWriter, r *http.Request) ([]*Gps, error)

GetAllGPS function for get all data from table gps

func GetGPS

func GetGPS(w http.ResponseWriter, r *http.Request) (*Gps, error)

GetGPS functionfor get pergps

type ManyGps

type ManyGps []Gps

strtuck for many gps array

type ManyUser

type ManyUser []User

type Token

type Token struct {
	UserId  uint      `json:"user_id,omitemp"`
	Email   string    `json:"email,omitemp"`
	TimeExp time.Time `json:"time_exp,omitemp"`
	jwt.StandardClaims
}

type User

type User struct {
	Email    string `json:"email,omitemp"`
	Username string `json:"username,omitemp"`
	Password string `json:"password,omitemp"`
	Status   string `json:"status,omitemp"`
	gorm.Model
}

func GetAllUserPanel

func GetAllUserPanel(w http.ResponseWriter, r *http.Request) ([]*User, error)

GetAllUserPanel function for get all data from table user

func GetUserPanel

func GetUserPanel(w http.ResponseWriter, r *http.Request) (*User, error)

GetUserPanel functionfor get perUser

func (*User) Login

func (registeredUser *User) Login() map[string]interface{}

func (*User) RegisterUserPanel

func (user *User) RegisterUserPanel() map[string]interface{}

RegisterUserPanel function for register first time user

func (*User) Validate

func (user *User) Validate() (map[string]interface{}, bool)

Jump to

Keyboard shortcuts

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