Documentation ¶
Index ¶
- Constants
- Variables
- func DBMTransact(dbMap *gorp.DbMap, txFunc func(*gorp.Transaction) error) (err error)
- func InitDB()
- func InsertBatch(db gorp.SqlExecutor, list ...interface{}) error
- func UpdateArticle(db gorp.SqlExecutor, urlID, title, brief string, body template.HTML, ...) error
- type Article
- type Auth
- type Validator
Constants ¶
View Source
const ( ArticleKindDoc = 1 ArticleKindTech = 2 )
Variables ¶
View Source
var (
DbMap *gorp.DbMap
)
Functions ¶
func DBMTransact ¶
func InsertBatch ¶
func InsertBatch(db gorp.SqlExecutor, list ...interface{}) error
Types ¶
type Article ¶
type Article struct { Id int `json:"id" db:"id"` UrlID string `json:"url_id" db:"url_id"` Title string `json:"title" db:"title"` Icon string `json:"icon" db:"icon"` Kind int `json:"kind" db:"kind"` Visited int `json:"visited" db:"visited"` Brief string `json:"brief" db:"brief"` Body template.HTML `json:"body" db:"body"` CreateTime time.Time `json:"create_time" db:"create_time"` UpdatedTime time.Time `json:"updated_time" db:"updated_time"` }
func GetArticle ¶
func ListArticles ¶
func TopArticles ¶
Click to show internal directories.
Click to hide internal directories.