Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove /twitchemotes/ endpoints #465

Merged
merged 5 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Breaking: Remove the `/twitchemotes/` endpoints. See [issue 332](https://github.com/Chatterino/api/issues/332) for more information. (#465)

## 2.0.2

- Minor: Our User-Agent now properly reflects the version of the API. (#459)
Expand Down
7 changes: 0 additions & 7 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import (
"net/url"
"time"

"github.com/Chatterino/api/internal/caches/twitchusernamecache"
"github.com/Chatterino/api/internal/db"
"github.com/Chatterino/api/internal/logger"
"github.com/Chatterino/api/internal/migration"
defaultresolver "github.com/Chatterino/api/internal/resolvers/default"
"github.com/Chatterino/api/internal/routes/twitchemotes"
"github.com/Chatterino/api/internal/twitchapiclient"
"github.com/Chatterino/api/pkg/cache"
"github.com/Chatterino/api/pkg/config"
Expand Down Expand Up @@ -124,23 +122,18 @@ func main() {
// Strip trailing slashes from API requests
router.Use(StripSlashes)

var helixUsernameCache cache.Cache

helixClient, err := twitchapiclient.New(ctx, cfg)
if err != nil {
log.Warnw("Error initializing Twitch API client",
"error", err,
)
} else {
helixUsernameCache = twitchusernamecache.New(ctx, cfg, pool, helixClient)
}

if cfg.EnablePrometheus {
// Host a prometheus metrics instance on cfg.PrometheusBindAddress (127.0.0.1:9382 by default)
listenPrometheus(cfg)
}

twitchemotes.Initialize(ctx, cfg, pool, router, helixClient, helixUsernameCache)
handleRoot(router)
handleHealth(router)
handleLegal(router)
Expand Down
24 changes: 0 additions & 24 deletions internal/caches/twitchusernamecache/cache.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/caches/twitchusernamecache/cache_test.go

This file was deleted.

36 changes: 0 additions & 36 deletions internal/caches/twitchusernamecache/username_loader.go

This file was deleted.

70 changes: 0 additions & 70 deletions internal/routes/twitchemotes/initialize.go

This file was deleted.

28 changes: 0 additions & 28 deletions internal/routes/twitchemotes/initialize_test.go

This file was deleted.

101 changes: 0 additions & 101 deletions internal/routes/twitchemotes/set_loader.go

This file was deleted.