models

package
v0.0.0-...-3155b3f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOptions

func GetOptions() map[string]string

func Md5

func Md5(buf []byte) string

func Rawurlencode

func Rawurlencode(str string) string

func TableName

func TableName(str string) string

返回带前缀的表名

Types

type Album

type Album struct {
	Id       int64
	Name     string    `orm:"size(100)"`
	Cover    string    `orm:"size(70)"`
	Posttime time.Time `orm:"type(datetime);index"`
	Ishide   int8
	Rank     int8
	Photonum int64
}

相册表

func (*Album) Delete

func (m *Album) Delete() error

func (*Album) Insert

func (m *Album) Insert() error

func (*Album) Query

func (m *Album) Query() orm.QuerySeter

func (*Album) Read

func (m *Album) Read(fields ...string) error

func (*Album) TableName

func (m *Album) TableName() string

func (*Album) Update

func (m *Album) Update(fields ...string) error
type Link struct {
	Id       int64
	Sitename string `orm:"size(80)"`
	Url      string `orm:"size(200)"`
	Rank     int8
}

友情链接

func GetLinks() []*Link

func (*Link) Delete

func (m *Link) Delete() error

删除

func (*Link) Insert

func (m *Link) Insert() error

func (*Link) Query

func (m *Link) Query() orm.QuerySeter

表查询

func (*Link) Read

func (m *Link) Read(fields ...string) error

func (*Link) TableName

func (m *Link) TableName() string

func (*Link) Update

func (m *Link) Update(fields ...string) error

type LocalCache

type LocalCache struct {
	// contains filtered or unexported fields
}
var Cache *LocalCache = NewCache()

func NewCache

func NewCache() *LocalCache

func (*LocalCache) Delete

func (this *LocalCache) Delete(key string) error

func (*LocalCache) Get

func (this *LocalCache) Get(key string) interface{}

func (*LocalCache) IsExist

func (this *LocalCache) IsExist(key string) bool

func (*LocalCache) Put

func (this *LocalCache) Put(key string, val interface{}) error

type Mood

type Mood struct {
	Id       int64
	Content  string    `orm:"type(text)"`
	Cover    string    `orm:"size(70)"`
	Posttime time.Time `orm:"type(datetime);index"`
}

心情表

func (*Mood) Delete

func (m *Mood) Delete() error

func (*Mood) Insert

func (m *Mood) Insert() error

func (*Mood) Query

func (m *Mood) Query() orm.QuerySeter

func (*Mood) Read

func (m *Mood) Read(fields ...string) error

func (*Mood) TableName

func (m *Mood) TableName() string

func (*Mood) Update

func (m *Mood) Update(fields ...string) error

type Option

type Option struct {
	Id    int64
	Name  string
	Value string
}

配置项表

func (*Option) Delete

func (m *Option) Delete() error

func (*Option) Insert

func (m *Option) Insert() error

func (*Option) Query

func (m *Option) Query() orm.QuerySeter

func (*Option) Read

func (m *Option) Read(fields ...string) error

func (*Option) TableName

func (m *Option) TableName() string

func (*Option) Update

func (m *Option) Update(fields ...string) error

type Pager

type Pager struct {
	Page     int64
	Totalnum int64
	Pagesize int64
	// contains filtered or unexported fields
}

func NewPager

func NewPager(page, totalnum, pagesize int64, urlpath string) *Pager

func (*Pager) ToString

func (this *Pager) ToString() string

type Photo

type Photo struct {
	Id       int64
	Albumid  int64
	Des      string    `orm:"size(100)"`
	Posttime time.Time `orm:"type(datetime);index"`
	Url      string    `orm:"size(70)"`
	Small    string    `orm:"-"`
}

相册表

func (*Photo) Delete

func (m *Photo) Delete() error

func (*Photo) Insert

func (m *Photo) Insert() error

func (*Photo) Query

func (m *Photo) Query() orm.QuerySeter

func (*Photo) Read

func (m *Photo) Read(fields ...string) error

func (*Photo) TableName

func (m *Photo) TableName() string

func (*Photo) Update

func (m *Photo) Update(fields ...string) error

type Post

type Post struct {
	Id       int64
	Userid   int64     `orm:"index"`
	Author   string    `orm:"size(15)"`
	Title    string    `orm:"size(100)"`
	Color    string    `orm:"size(7)"`
	Urlname  string    `orm:"size(100);index"`
	Urltype  int8      ``
	Content  string    `orm:"type(text)"`
	Tags     string    `orm:"size(100)"`
	Posttime time.Time `orm:"type(datetime);index"`
	Views    int64     ``
	Status   int8      ``
	Updated  time.Time `orm:"type(datetime)"`
	Istop    int8      ``
	Cover    string    `orm:"size(70)"`
}

func GetHotBlog

func GetHotBlog() []*Post

func GetLatestBlog

func GetLatestBlog() []*Post

func (*Post) ColorTitle

func (m *Post) ColorTitle() string

带颜色的标题

func (*Post) Delete

func (m *Post) Delete() error

func (*Post) Excerpt

func (m *Post) Excerpt() string

摘要

func (*Post) GetPreAndNext

func (post *Post) GetPreAndNext() (pre, next *Post)

func (*Post) Insert

func (m *Post) Insert() error
func (m *Post) Link() string

内容URL

func (*Post) Query

func (m *Post) Query() orm.QuerySeter

func (*Post) Read

func (m *Post) Read(fields ...string) error

func (*Post) TableName

func (m *Post) TableName() string
func (m *Post) TagsLink() string

带链接的标签

func (*Post) Update

func (m *Post) Update(fields ...string) error

type Tag

type Tag struct {
	Id    int64
	Name  string `orm:"size(20);index"`
	Count int64
}

标签表

func (*Tag) Delete

func (m *Tag) Delete() error

删除

func (*Tag) Insert

func (m *Tag) Insert() error
func (m *Tag) Link() string

标签连接

func (*Tag) MergeTo

func (m *Tag) MergeTo(to *Tag)

合并到另一个标签

func (*Tag) Query

func (m *Tag) Query() orm.QuerySeter

表查询

func (*Tag) Read

func (m *Tag) Read(fields ...string) error

func (*Tag) TableName

func (m *Tag) TableName() string

func (*Tag) UpCount

func (m *Tag) UpCount()

更新统计

func (*Tag) Update

func (m *Tag) Update(fields ...string) error

type TagPost

type TagPost struct {
	Id         int64
	Tagid      int64 `orm:"index"`
	Postid     int64
	Poststatus int8
	Posttime   time.Time
}

标签内容关系表

func (*TagPost) Delete

func (m *TagPost) Delete() error

func (*TagPost) Insert

func (m *TagPost) Insert() error

func (*TagPost) Query

func (m *TagPost) Query() orm.QuerySeter

func (*TagPost) Read

func (m *TagPost) Read(fields ...string) error

func (*TagPost) TableName

func (m *TagPost) TableName() string

func (*TagPost) Update

func (m *TagPost) Update(fields ...string) error

type User

type User struct {
	Id         int64
	Username   string    `orm:"unique;size(15)"`
	Password   string    `orm:"size(32)"`
	Email      string    `orm:"size(50)"`
	Lastlogin  time.Time `orm:"auto_now_add;type(datetime)"`
	Logincount int64
	Lastip     string `orm:"size(32)"`
	Authkey    string `orm:"size(10)"`
	Active     int8
}

用户表模型

func (*User) Delete

func (m *User) Delete() error

func (*User) Insert

func (m *User) Insert() error

func (*User) Query

func (m *User) Query() orm.QuerySeter

func (*User) Read

func (m *User) Read(fields ...string) error

func (*User) TableName

func (m *User) TableName() string

func (*User) Update

func (m *User) Update(fields ...string) error

Jump to

Keyboard shortcuts

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