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.
pic/picture.go

32 lines
810 B
Go

1 year ago
package pic
import (
"fmt"
1 year ago
"github.com/jmoiron/sqlx"
1 year ago
)
1 year ago
//Picture работа с картинкаи
type Picture struct {
ID int `json:"id"`
Url string `json:"src"`
Width int `json:"width"`
Height int `json:"height"`
Thumb string `json:"srct"`
ThumbWidth int `db:"thumb_width" json:"imgtWidth"`
ThumbHeight int `db:"thumb_height" json:"imgtHeight"`
// закрытые поля
db *sqlx.DB
album string
}
//Hello - приветствие и комментарии к модулю
1 year ago
func Hello() {
fmt.Printf("pic - пакет для работы с картинками\n")
1 year ago
fmt.Printf("v0.0.1 - начальная версия\n")
}
func NewPicture(db *sqlx.DB, album string) Picture {
pic := Picture {db: db, album: album}
return pic
1 year ago
}