diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2023-04-15 21:35:06 +0200 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2023-04-17 04:17:45 +0200 |
commit | 5559e0134382a141f5edabdacf1dc81f12b55c27 (patch) | |
tree | 0cd897880e52572f1e12334dfe94535a140549ce /src/cmd | |
parent | 7872296b838f4d1b26c6a0a01d79d27fe5ab44cc (diff) |
Implement asset.Loader
This moved a bunch of logic out of http and into the asset package,
making it available for gmit too.
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/mediocre-blog/main.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/mediocre-blog/main.go b/src/cmd/mediocre-blog/main.go index aff0f8e..ee09f92 100644 --- a/src/cmd/mediocre-blog/main.go +++ b/src/cmd/mediocre-blog/main.go @@ -101,7 +101,13 @@ func main() { defer postSQLDB.Close() postStore := post.NewStore(postSQLDB) + postAssetStore := asset.NewStore(postSQLDB) + + postAssetLoader := asset.NewStoreLoader(postAssetStore) + postAssetLoader = asset.NewArchiveLoader(postAssetLoader) + postAssetLoader = asset.NewImageLoader(postAssetLoader) + postDraftStore := post.NewDraftStore(postSQLDB) cache := cache.New(5000) @@ -111,6 +117,7 @@ func main() { httpParams.PowManager = powMgr httpParams.PostStore = postStore httpParams.PostAssetStore = postAssetStore + httpParams.PostAssetLoader = postAssetLoader httpParams.PostDraftStore = postDraftStore httpParams.MailingList = ml httpParams.GeminiPublicURL = gmiParams.PublicURL @@ -132,7 +139,7 @@ func main() { gmiParams.Logger = logger.WithNamespace("gmi") gmiParams.Cache = cache gmiParams.PostStore = postStore - gmiParams.PostAssetStore = postAssetStore + gmiParams.PostAssetLoader = postAssetLoader gmiParams.HTTPPublicURL = httpParams.PublicURL logger.Info(ctx, "starting gmi api") |