models

package
v0.0.0-...-99920e5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQL_UPDATE_COMMENT  = `UPDATE comments SET eid=?,user=?,email=?,url=?,title=?,content=?,atime = datetime('now','localtime') WHERE id = ?;`
	SQL_INSERT_COMMENT  = `` /* 144-byte string literal not displayed */
	SQL_SELECT_COMMENTS = `SELECT id,eid,ctime,atime,user,email,url,title,content FROM comments WHERE eid=? ORDER BY id;`
)
View Source
const (
	SQL_UPDATE_ENTRY   = `UPDATE entries SET slug=?,name=?,abbrs=?,caption=?,atime = datetime('now','localtime') WHERE id = ?;`
	SQL_INSERT_ENTRY   = `` /* 131-byte string literal not displayed */
	SQL_SELECT_ENTRIES = `SELECT id,slug,name,ctime,atime,abbrs,caption FROM entries;`
)

Variables

This section is empty.

Functions

func InitDB

func InitDB(driverName, dataSourceName string) (err error)

Types

type Comment

type Comment struct {
	ID      int64
	Entry   int64
	User    string
	Email   string
	URL     string
	Title   string
	Content string
	CTime   time.Time
	ATime   time.Time
}

func (*Comment) Save

func (self *Comment) Save() (err error)

type Comments

type Comments struct {
}

func (*Comments) Filter

func (self *Comments) Filter(offset, count int, entry int64) (comments []Comment, err error)

type Entries

type Entries struct {
}

func (*Entries) Search

func (self *Entries) Search(offset, count int, words string) (entries []Entry, total int, err error)

type Entry

type Entry struct {
	ID      int64
	Slug    string
	Name    string
	Abbrs   string
	Caption string
	CTime   time.Time
	ATime   time.Time
}

func (*Entry) Save

func (self *Entry) Save() (err error)

Jump to

Keyboard shortcuts

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