family is home
parent
5181aabd14
commit
5dd8de09de
@ -1,3 +1,5 @@
|
||||
module gitea.wagshome.duckdns.org/nathan/golearn
|
||||
|
||||
go 1.20
|
||||
|
||||
require github.com/go-sql-driver/mysql v1.7.1 // indirect
|
||||
|
@ -0,0 +1,2 @@
|
||||
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
@ -0,0 +1,30 @@
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue