models

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Active

type Active struct {
	Status    int       `json:"status"`
	UpdatedAt time.Time `bson:"updated_at,omitempty" json:"updatedAt"`
}

type ActiveInfo

type ActiveInfo struct {
	Id     string
	Expire int64
}

type ActiveUrl

type ActiveUrl struct {
	Url  string
	Info string
}

type Comment

type Comment struct {
	ID        bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Content   string        `bson:"content,omitempty" json:"content"`
	TopicID   bson.ObjectId `bson:"topic_id,omitempty" json:"topicID"`
	UserID    bson.ObjectId `bson:"user_id,omitempty" json:"userID"`
	CreatedAt time.Time     `bson:"created_at,omitempty" json:"createdAt"`
	UpdatedAt time.Time     `bson:"updated_at,omitempty" json:"updatedAt"`
}

User struct

type Password

type Password struct {
	Password          string `json:"password" binding:"required,min=1,max=16"`
	RePassword        string `json:"re_password" binding:"required,min=8,max=16"`
	ReConfirmPassword string `json:"re_confirm_password" binding:"eqfield=RePassword"`
}

type QFile

type QFile struct {
	ID        bson.ObjectId `bson:"_id" json:"id"`
	Name      string        `bson:"key" json:"key"`
	Hash      string        `bson:"hash" json:"hash"`
	FSize     int64         `bson:"fsize" json:"fsize"`
	Bucket    string        `bson:"bucket" json:"bucket"`
	CreatedAt time.Time     `bson:"created_at" json:"createdAt"`
	UpdatedAt time.Time     `bson:"updated_at" json:"updatedAt"`
}

type Topic

type Topic struct {
	ID          bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Title       string        `bson:"title,omitempty" json:"title"`
	Description string        `bson:"description,omitempty" json:"description"`
	Content     string        `bson:"content,omitempty" json:"content"`
	View        int           `bson:"view,omitempty" json:"view"`
	UserID      bson.ObjectId `bson:"user_id,omitempty" json:"userID"`
	CreatedAt   time.Time     `bson:"created_at,omitempty" json:"createdAt"`
	UpdatedAt   time.Time     `bson:"updated_at,omitempty" json:"updatedAt"`
}

Topic struct

type Update

type Update struct {
	Name        string    `json:"name" binding:"min=4,max=12"`
	Description string    `json:"description" binding:"min=1,max=255"`
	Status      int       `json:"status"`
	UpdatedAt   time.Time `bson:"updated_at,omitempty" json:"updatedAt"`
}

type User

type User struct {
	ID          bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Name        string        `bson:"name,omitempty" json:"name"`
	Description string        `bson:"description,omitempty" json:"description"`
	Email       string        `bson:"email,omitempty" json:"email"`
	Password    string        `bson:"password,omitempty" json:"password"`
	Status      int           `bson:"status,omitempty" json:"status"`
	Admin       bool          `bson:"admin,omitempty" json:"admin"`
	Avatar      string        `bson:"avatar,omitempty" json:"avatar"`
	CreatedAt   time.Time     `bson:"created_at,omitempty" json:"createdAt"`
	UpdatedAt   time.Time     `bson:"updated_at,omitempty" json:"updatedAt"`
}

User struct

Jump to

Keyboard shortcuts

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