models

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 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 Image

type Image struct {
	Id         int64     `json:"id"`
	Thumb      string    `json:"thumb"`
	Url        string    `json:"url"`
	Image      string    `json:"image"`
	MimeType   string    `json:"mime_type"`
	Title      string    `json:"title"`
	Size       int64     `json:"size"`
	Name       string    `json:"name"`
	Created_at time.Time `json:"created_at"`
}

type Role

type Role struct {
	Name        string              `json:"name"`
	Description string              `json:"description"`
	Parent      *Role               `json:"parent"`
	Children    []*Role             `json:"children"`
	AccessList  map[string][]string `json:"access_list"`
	Created_at  time.Time           `json:"created_at"`
	Update_at   time.Time           `json:"update_at"`
}

type User

type User struct {
	Id        int64  `json:"id"`
	Nickname  string `json:"nickname"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`

	Email   string         `json:"email"`
	History []*UserHistory `json:"history"`
	Status  string         `json:"status"`

	Avatar          *Image `json:"avatar"`
	SignInCount     int64  `json:"sign_in_count"`
	CurrentSignInIp string `json:"current_sign_in_ip"`
	LastSignInIp    string `json:"last_sign_in_ip"`

	CreatedBy *User       `json:"created_by"`
	Role      *Role       `json:"role"`
	Meta      []*UserMeta `json:"meta"`
	Lang      string      `json:"lang"`

	CurrentSignInAt time.Time `json:"current_sign_in_at"`
	LastSignInAt    time.Time `json:"last_sign_in_at"`
	Created_at      time.Time `json:"created_at"`
	Update_at       time.Time `json:"update_at"`
}

type UserHistory added in v0.0.6

type UserHistory struct {
	Ip   string    `json:"ip"`
	Time time.Time `json:"time"`
}

type UserMeta

type UserMeta struct {
	Id    int64  `orm:"pk;auto" json:"id"`
	User  *User  `orm:"rel(fk)" json:"-"`
	Key   string `orm:"size(255)" valid:"MaxSize(255)" json:"key"`
	Value string `orm:"size(255)" valid:"MaxSize(255)" json:"value"`
}

Jump to

Keyboard shortcuts

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