repository

package
v0.0.0-...-36b4345 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuestionModel

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

QuestionModel -- have method about question table in database

func NewQuestionModel

func NewQuestionModel(db *sqlx.DB) *QuestionModel

NewQuestionModel QuestionModelの初期化

func (*QuestionModel) All

func (q *QuestionModel) All() ([]model.Question, error)

All -- SELECT * FROM questions

func (*QuestionModel) Create

func (q *QuestionModel) Create(question *model.Question) error

Create -- Insert question data

func (*QuestionModel) FindByID

func (q *QuestionModel) FindByID(id uint64) (*model.Question, error)

FindByID -- Find question data in database

type UserModel

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

UserModel -- have method about user table in database

func NewUserModel

func NewUserModel(db *sqlx.DB) *UserModel

NewUserModel UserModelの初期化

func (*UserModel) All

func (u *UserModel) All() ([]model.User, error)

All -- SELECT * FROM users

func (*UserModel) Create

func (u *UserModel) Create(user *model.User) error

Create -- INSERT user

func (*UserModel) FindByEmail

func (u *UserModel) FindByEmail(email string) (*model.User, error)

FindByEmail -- find user in database

Jump to

Keyboard shortcuts

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