controller

package
v0.0.0-...-3b0bfdb Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserController *UserC
	WordController *WordC
)

Functions

This section is empty.

Types

type BaseC

type BaseC struct {
	DB *gorm.DB
}

BaseC BaseController struct

func (*BaseC) Close

func (base *BaseC) Close()

Close sql connection

func (*BaseC) Connect

func (base *BaseC) Connect() *gorm.DB

Connect mysql connection

type UserC

type UserC struct {
	*BaseC
}

func (*UserC) Create

func (uc *UserC) Create(user *model.User) (map[string]interface{}, bool)

Create User

func (*UserC) GetUser

func (uc *UserC) GetUser(u uint) *model.User

GetUser

func (*UserC) Login

func (uc *UserC) Login(email, password string) (map[string]interface{}, bool)

Login user

func (*UserC) Validate

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

Validate incoming user details...

type WordC

type WordC struct {
	*BaseC
}

func (*WordC) Add

func (wc *WordC) Add(word *model.Word, user *model.User)

Add word

func (*WordC) Delete

func (wc *WordC) Delete(word *model.Word)

Delete a word

func (*WordC) Get

func (wc *WordC) Get(word *model.Word) model.Word

Get a word

func (*WordC) GetAll

func (wc *WordC) GetAll() (words []model.Word)

GetAll words TODO pagination

func (*WordC) Update

func (wc *WordC) Update(in *model.Word, data map[string]interface{})

Jump to

Keyboard shortcuts

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