models

package
v0.0.0-...-0067e36 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	ID        uint      `json:"id"`
	Title     string    `json:"title"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type MessageStruct

type MessageStruct struct {
	Title string    `json:"title"`
	Value string    `json:"value"`
	When  time.Time `json:"when"`
}

type News

type News struct {
	ID           uint      `json:"id"`
	Title        string    `json:"title"`
	Slug         string    `json:"slug,omitempty"`
	Content      string    `json:"content,omitempty"`
	Image        string    `json:"image,omitempty"`
	ImageCaption string    `json:"image_caption,omitempty"`
	Status       string    `json:"status,omitempty"`
	PublishDate  time.Time `json:"publish_date,omitempty"`
	Writer       User      `json:"writer,omitempty"`
	Editor       User      `json:"editor,omitempty"`
	Topic        []Topic   `json:"topic"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
}

func NewsValidate

func NewsValidate(o News) News

type NewsNull

type NewsNull struct {
	Content      sql.NullString
	Image        sql.NullString
	ImageCaption sql.NullString
	PublishDate  mysql.NullTime
	Editor       sql.NullInt64
}

type Topic

type Topic struct {
	ID        uint      `json:"id"`
	Title     string    `json:"title"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func TopicValidate

func TopicValidate(o Topic) Topic

type User

type User struct {
	ID          uint      `json:"id"`
	Name        string    `json:"name"`
	Email       string    `json:"email"`
	Password    []byte    `json:"password"`
	Group       Group     `json:"group"`
	IsActive    bool      `json:"is_active"`
	PhoneNumber string    `json:"phone_number"`
	Photo       string    `json:"photo"`
	Biography   string    `json:"biography"`
	Birthdate   time.Time `json:"birthdate,string,omitempty"`
	Gender      string    `json:"gender"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

func UserValidation

func UserValidation(user User) (User, error)

type UserNull

type UserNull struct {
	PhoneNumber sql.NullString
	Photo       sql.NullString
	Biography   sql.NullString
	Birthdate   mysql.NullTime
}

Jump to

Keyboard shortcuts

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