[chore] deinterface the typeutils.Converter and update to use state structure (#2217)

* update typeconverter to use state structure

* deinterface the typeutils.TypeConverter -> typeutils.Converter

* finish copying over old type converter code comments

* fix cherry-pick merge issues, fix tests pointing to old typeutils interface type still
This commit is contained in:
kim
2023-09-23 17:44:11 +01:00
committed by GitHub
parent 1b848aa1e5
commit 8f67dd583d
119 changed files with 611 additions and 742 deletions

View File

@@ -70,7 +70,7 @@ func (p *Processor) packageAccounts(
continue
}
apiAccount, err := p.tc.AccountToAPIAccountPublic(ctx, account)
apiAccount, err := p.converter.AccountToAPIAccountPublic(ctx, account)
if err != nil {
log.Debugf(ctx, "skipping account %s because it couldn't be converted to its api representation: %s", account.ID, err)
continue
@@ -105,7 +105,7 @@ func (p *Processor) packageStatuses(
continue
}
apiStatus, err := p.tc.StatusToAPIStatus(ctx, status, requestingAccount)
apiStatus, err := p.converter.StatusToAPIStatus(ctx, status, requestingAccount)
if err != nil {
log.Debugf(ctx, "skipping status %s because it couldn't be converted to its api representation: %s", status.ID, err)
continue
@@ -137,7 +137,7 @@ func (p *Processor) packageHashtags(
} else {
// If API not version 1, provide slice of full tags.
rangeF = func(tag *gtsmodel.Tag) {
apiTag, err := p.tc.TagToAPITag(ctx, tag, true)
apiTag, err := p.converter.TagToAPITag(ctx, tag, true)
if err != nil {
log.Debugf(
ctx,