mirror of
https://github.com/1f349/site-hosting.git
synced 2025-01-20 22:26:37 +00:00
Rename sitesQueries in serve and upload
This commit is contained in:
parent
40a52773f7
commit
4ecd88c0c0
@ -45,17 +45,17 @@ const (
|
|||||||
NoCacheQuery = "/?__bluebell-no-cache="
|
NoCacheQuery = "/?__bluebell-no-cache="
|
||||||
)
|
)
|
||||||
|
|
||||||
type sitesQueries interface {
|
type serveQueries interface {
|
||||||
GetLastUpdatedByDomainBranch(ctx context.Context, params database.GetLastUpdatedByDomainBranchParams) (time.Time, error)
|
GetLastUpdatedByDomainBranch(ctx context.Context, params database.GetLastUpdatedByDomainBranchParams) (time.Time, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage afero.Fs, db sitesQueries) *Handler {
|
func New(storage afero.Fs, db serveQueries) *Handler {
|
||||||
return &Handler{storage, db}
|
return &Handler{storage, db}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
storageFs afero.Fs
|
storageFs afero.Fs
|
||||||
db sitesQueries
|
db serveQueries
|
||||||
}
|
}
|
||||||
|
|
||||||
func cacheBuster(rw http.ResponseWriter, req *http.Request) {
|
func cacheBuster(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -27,11 +27,11 @@ var indexBranches = []string{
|
|||||||
"master",
|
"master",
|
||||||
}
|
}
|
||||||
|
|
||||||
type sitesQueries interface {
|
type uploadQueries interface {
|
||||||
GetSiteByDomain(ctx context.Context, domain string) (database.Site, error)
|
GetSiteByDomain(ctx context.Context, domain string) (database.Site, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage afero.Fs, db sitesQueries) *Handler {
|
func New(storage afero.Fs, db uploadQueries) *Handler {
|
||||||
return &Handler{storageFs: storage, db: db}
|
return &Handler{storageFs: storage, db: db}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ const maxFileSize = 1 * humanize.GiByte
|
|||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
storageFs afero.Fs
|
storageFs afero.Fs
|
||||||
db sitesQueries
|
db uploadQueries
|
||||||
mu syncmap.Map[string, *sync.Mutex]
|
mu syncmap.Map[string, *sync.Mutex]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user