models

package
v0.0.0-...-1c4dd04 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Id      int64 `orm:"pk;auto"`
	Content string
}

The comment information

func GetComments

func GetComments() []*Comment

Return last 9 comment objects

func (*Comment) TableEngine

func (*Comment) TableEngine() string

type Item

type Item struct {
	Id          int64  `orm:"pk;auto"`
	Username    string //`form:"username"`
	Number      int64  //`form:"number"`
	Image       string //`form:"image"`
	Description string //`form:"description"`
}

The item information and one item belongs to one user

func GetUserItems

func GetUserItems(username string) []*Item

Give username and return item objects

func (*Item) TableEngine

func (*Item) TableEngine() string

type User

type User struct {
	Name        string `orm:"pk"`
	Email       string
	Description string
}

The user infomation and one user has one or more items

func GetUser

func GetUser(username string) *User

Give username and return user object

func GetUsers

func GetUsers() []*User

Return all user objects

func (*User) TableEngine

func (*User) TableEngine() string

Jump to

Keyboard shortcuts

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