You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
456 B
Go
31 lines
456 B
Go
1 year ago
|
package models
|
||
|
|
||
|
import (
|
||
|
"database/sql"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type Snippet struct {
|
||
|
ID int
|
||
|
Title string
|
||
|
Content string
|
||
|
Created time.Time
|
||
|
Expires time.Time
|
||
|
}
|
||
|
|
||
|
type SnippetModel struct {
|
||
|
DB *sql.DB
|
||
|
}
|
||
|
|
||
|
func (m *SnippetModel) Insert(title string, content string, expires int) (int, error) {
|
||
|
return 0, nil
|
||
|
}
|
||
|
|
||
|
func (m *SnippetModel) Get(id int) (*Snippet, error) {
|
||
|
return nil, nil
|
||
|
}
|
||
|
|
||
|
func (m *SnippetModel) Latest() ([]*Snippet, error) {
|
||
|
return nil, nil
|
||
|
}
|