From 7cc40302a578264dff4edb3b007fc192b840c7d4 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sun, 10 Jul 2022 16:18:21 +0100 Subject: [chore] consolidate caching libraries (#704) * add miekg/dns dependency * set/validate accountDomain * move finger to dereferencer * totally break GetRemoteAccount * start reworking finger func a bit * start reworking getRemoteAccount a bit * move mention parts to namestring * rework webfingerget * use util function to extract webfinger parts * use accountDomain * rework finger again, final form * just a real nasty commit, the worst * remove refresh from account * use new ASRepToAccount signature * fix incorrect debug call * fix for new getRemoteAccount * rework GetRemoteAccount * start updating tests to remove repetition * break a lot of tests Move shared test logic into the testrig, rather than having it scattered all over the place. This allows us to just mock the transport controller once, and have all tests use it (unless they need not to for some other reason). * fix up tests to use main mock httpclient * webfinger only if necessary * cheeky linting with the lads * update mentionName regex recognize instance accounts * don't finger instance accounts * test webfinger part extraction * increase default worker count to 4 per cpu * don't repeat regex parsing * final search for discovered accountDomain * be more permissive in namestring lookup * add more extraction tests * simplify GetParseMentionFunc * skip long search if local account * fix broken test * consolidate to all use same caching libraries Signed-off-by: kim * perform more caching in the database layer Signed-off-by: kim * remove ASNote cache Signed-off-by: kim * update cache library, improve db tracing hooks Signed-off-by: kim * return ErrNoEntries if no account status IDs found, small formatting changes Signed-off-by: kim * fix tests, thanks tobi! Signed-off-by: kim Co-authored-by: tsmethurst --- go.mod | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'go.mod') diff --git a/go.mod b/go.mod index 87618464d..420facc6f 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,13 @@ module github.com/superseriousbusiness/gotosocial go 1.18 require ( - codeberg.org/gruf/go-byteutil v1.0.1 - codeberg.org/gruf/go-cache/v2 v2.0.1 - codeberg.org/gruf/go-debug v1.1.2 - codeberg.org/gruf/go-errors/v2 v2.0.1 + codeberg.org/gruf/go-byteutil v1.0.2 + codeberg.org/gruf/go-cache/v2 v2.1.1 + codeberg.org/gruf/go-debug v1.2.0 + codeberg.org/gruf/go-errors/v2 v2.0.2 codeberg.org/gruf/go-mutexes v1.1.2 codeberg.org/gruf/go-runners v1.2.1 - codeberg.org/gruf/go-store v1.3.7 - github.com/ReneKroon/ttlcache v1.7.0 + codeberg.org/gruf/go-store v1.3.8 github.com/buckket/go-blurhash v1.1.0 github.com/coreos/go-oidc/v3 v3.1.0 github.com/gin-contrib/cors v1.3.1 @@ -45,6 +44,7 @@ require ( github.com/uptrace/bun/dialect/sqlitedialect v1.1.3 github.com/wagslane/go-password-validator v0.3.0 golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f + golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d golang.org/x/net v0.0.0-20220524220425-1d687d428aca golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 golang.org/x/text v0.3.7 @@ -54,12 +54,14 @@ require ( ) require ( - codeberg.org/gruf/go-bitutil v1.0.0 // indirect + codeberg.org/gruf/go-atomics v1.1.0 // indirect + codeberg.org/gruf/go-bitutil v1.0.1 // indirect codeberg.org/gruf/go-bytes v1.0.2 // indirect codeberg.org/gruf/go-fastcopy v1.1.1 // indirect codeberg.org/gruf/go-fastpath v1.0.3 // indirect codeberg.org/gruf/go-hashenc v1.0.2 // indirect codeberg.org/gruf/go-pools v1.1.0 // indirect + codeberg.org/gruf/go-sched v1.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dsoprea/go-exif/v3 v3.0.0-20210625224831-a6301f85c82b // indirect -- cgit v1.3