models

package
v0.0.0-...-844f6a4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PAGINATION_DEFAULT_LENGTH int = 10
)

Variables

View Source
var (
	DbMap *gorp.DbMap
)

Functions

This section is empty.

Types

type Chatroom

type Chatroom struct {
	Id          int
	Code        string
	MaxMembers  int
	Locked      bool
	EndDatetime *time.Time
	Model
}

type ChatroomManager

type ChatroomManager struct {
}

func (*ChatroomManager) AddTable

func (this *ChatroomManager) AddTable()

func (*ChatroomManager) Count

func (this *ChatroomManager) Count() int64

func (*ChatroomManager) Create

func (this *ChatroomManager) Create(chatroom *Chatroom) *Chatroom

func (*ChatroomManager) Find

func (this *ChatroomManager) Find(pagination *Pagination) []*Chatroom

func (*ChatroomManager) ListCacheKey

func (this *ChatroomManager) ListCacheKey(page int) string

func (*ChatroomManager) TableName

func (this *ChatroomManager) TableName() string

type Model

type Model struct {
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Model) PreInsert

func (m *Model) PreInsert(s gorp.SqlExecutor) error

func (*Model) PreUpdate

func (m *Model) PreUpdate(s gorp.SqlExecutor) error

type ModelStats

type ModelStats struct {
	Count int64
}

type Pagination

type Pagination struct {
	StartCount int
	EndCount   int
	TotalCount int64
	Page       int
	MaxPage    int
	Pages      []int
	Length     int
	Range      int
}

func NewPagination

func NewPagination(page int, length int, totalCount int64) *Pagination

type User

type User struct {
	Id   int
	Name string
	Type int
	Model
}

type UserManager

type UserManager struct {
}

func (*UserManager) AddTable

func (this *UserManager) AddTable()

func (*UserManager) Count

func (this *UserManager) Count(t int) int64

func (*UserManager) Create

func (this *UserManager) Create(user *User) *User

func (*UserManager) Find

func (this *UserManager) Find(t int, pagination *Pagination) []*User

func (*UserManager) TableName

func (this *UserManager) TableName() string

Jump to

Keyboard shortcuts

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