model

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Question

type Question struct {
	ID        uint64     `db:"id"`
	Title     string     `db:"title"`
	Body      string     `db:"body"`
	CreatedAt *time.Time `db:"created_at"`
	UpdatedAt *time.Time `db:"updated_at"`
	DeletedAt *time.Time `db:"deleted_at"`
	UID       uint64     `db:"user_id"`
}

Question -- This is question model

type QuestionModelImpl

type QuestionModelImpl interface {
	All() ([]Question, error)
	FindByID(id uint64) (*Question, error)
	Create(question *Question) error
}

QuestionModelImpl -- Define database control methods about question

type User

type User struct {
	ID        uint64     `db:"id"`
	Email     string     `db:"email"`
	Name      string     `db:"name"`
	CreatedAt *time.Time `db:"created_at"`
	UpdatedAt *time.Time `db:"updated_at"`
	DeletedAt *time.Time `db:"deleted_at"`
}

User -- This is user model

type UserModelImpl

type UserModelImpl interface {
	All() ([]User, error)
	Create(user *User) error
	FindByEmail(email string) (*User, error)
}

UserModelImpl -- Define database control methods about user

Jump to

Keyboard shortcuts

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