[chore] move caches to a separate State{} structure (#1078)

* move caches to a separate State{} structure

Signed-off-by: kim <grufwub@gmail.com>

* fix call to log.Panic not using formatted call

Signed-off-by: kim <grufwub@gmail.com>

* move caches to use interfaces, to make switchouts easier in future

Signed-off-by: kim <grufwub@gmail.com>

* fix rebase issue

Signed-off-by: kim <grufwub@gmail.com>

* improve code comment

Signed-off-by: kim <grufwub@gmail.com>

* fix further issues after rebase

Signed-off-by: kim <grufwub@gmail.com>

* heh

Signed-off-by: kim <grufwub@gmail.com>

* add missing license text

Signed-off-by: kim <grufwub@gmail.com>

Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
kim
2022-12-08 17:35:14 +00:00
committed by GitHub
parent dd1a4cd892
commit e58d2d8122
27 changed files with 725 additions and 332 deletions

View File

@ -2,7 +2,6 @@ package typeutils
import (
"context"
"fmt"
"time"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@ -13,7 +12,6 @@ import (
func (c *converter) FollowRequestToFollow(ctx context.Context, f *gtsmodel.FollowRequest) *gtsmodel.Follow {
showReblogs := *f.ShowReblogs
notify := *f.Notify
return &gtsmodel.Follow{
ID: f.ID,
CreatedAt: f.CreatedAt,
@ -33,8 +31,9 @@ func (c *converter) StatusToBoost(ctx context.Context, s *gtsmodel.Status, boost
if err != nil {
return nil, err
}
boostWrapperStatusURI := fmt.Sprintf("%s/%s", accountURIs.StatusesURI, boostWrapperStatusID)
boostWrapperStatusURL := fmt.Sprintf("%s/%s", accountURIs.StatusesURL, boostWrapperStatusID)
boostWrapperStatusURI := accountURIs.StatusesURI + "/" + boostWrapperStatusID
boostWrapperStatusURL := accountURIs.StatusesURL + "/" + boostWrapperStatusID
local := true
if boostingAccount.Domain != "" {