mirror of
https://github.com/KevinMidboe/planetposen-images.git
synced 2025-10-29 13:20:11 +00:00
App for fetching and uploading images to cloud bucket storage
This commit is contained in:
24
image/image.go
Normal file
24
image/image.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package image
|
||||
|
||||
import (
|
||||
"github.com/kevinmidboe/planetposen-images/util"
|
||||
)
|
||||
|
||||
// MessageImage is a representation of a single image in the database
|
||||
type Image struct {
|
||||
Path string `json:"path"`
|
||||
URL string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
// GetURL gets URL of the image, also in cases where MessageImage.URL is not defined.
|
||||
func (mi *Image) GetURL(hostname string) string {
|
||||
if mi.URL != "" {
|
||||
return mi.URL
|
||||
}
|
||||
return util.ImageURL(hostname, mi.Path)
|
||||
}
|
||||
|
||||
type PostImageData struct {
|
||||
// PageTitle string
|
||||
Filename string
|
||||
}
|
||||
Reference in New Issue
Block a user