controller

package
v0.0.0-...-23d6c9e Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuatBarangKeDb

func BuatBarangKeDb(barang *model.Barang) error

Barang

func BuatTableBarang

func BuatTableBarang(db *pg.DB) error

func BuatTableUser

func BuatTableUser(db *pg.DB) error

func BuatUserKeDb

func BuatUserKeDb(user *model.User) error

User

func DeleteBarang

func DeleteBarang(id string) bool

func DeleteUser

func DeleteUser(id string) (bool, error)

func EditBarang

func EditBarang(id string, barang *model.Barang) (*model.Barang, error)

func EditUser

func EditUser(id string, newUser *model.EditUser) (*model.User, error)

func EditUserPassword

func EditUserPassword(id string, newPass *model.EditUserPassword) (bool, error)

func InitiateDB

func InitiateDB(db *pg.DB)

func NyariBarangDiDb

func NyariBarangDiDb() []*model.Barang

func NyariBarangPakeId

func NyariBarangPakeId(id string) (*model.Barang, error)

func NyariUserDiDb

func NyariUserDiDb() []*model.User

func NyariUserPakeId

func NyariUserPakeId(id string) (*model.User, error)

Types

type LoginData

type LoginData struct {
	Role     string `json:"id"`
	Username string `json:"username"`
}

login

func AuthUser

func AuthUser(username, password string) (*LoginData, bool)

func UsernameAdaGak

func UsernameAdaGak(username string) (*LoginData, error)

Jump to

Keyboard shortcuts

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