stash/pkg/api/urlbuilders/gallery.go

20 lines
430 B
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package urlbuilders
import "strconv"
type GalleryURLBuilder struct {
BaseURL string
2019-02-09 12:30:49 +00:00
GalleryID string
}
func NewGalleryURLBuilder(baseURL string, galleryID int) GalleryURLBuilder {
return GalleryURLBuilder{
BaseURL: baseURL,
2019-02-09 12:30:49 +00:00
GalleryID: strconv.Itoa(galleryID),
}
}
func (b GalleryURLBuilder) GetGalleryImageURL(fileIndex int) string {
2019-02-09 12:30:49 +00:00
return b.BaseURL + "/gallery/" + b.GalleryID + "/" + strconv.Itoa(fileIndex)
}