···8585 }
8686 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID")
8787}
8888+8989+func (d *BaseDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error {
9090+ return nil
9191+}
+5
atproto/identity/cache_directory.go
···203203 }
204204 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID")
205205}
206206+207207+// XXX:
208208+func (d *CacheDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error {
209209+ return nil
210210+}
+3-1
atproto/identity/identity.go
···2929 LookupHandle(ctx context.Context, h syntax.Handle) (*Identity, error)
3030 LookupDID(ctx context.Context, d syntax.DID) (*Identity, error)
3131 Lookup(ctx context.Context, i syntax.AtIdentifier) (*Identity, error)
3232- // TODO: add "flush" methods to purge caches?
3232+3333+ // Flushes any cache of the indicated identifier. If directory is not using caching, can ignore this.
3434+ Purge(ctx context.Context, i syntax.AtIdentifier) error
3335}
34363537// Indicates that resolution process completed successfully, but handle does not exist.
+5-2
atproto/identity/mock_directory.go
···77 "github.com/bluesky-social/indigo/atproto/syntax"
88)
991010-// A fake identity directory , for use in tests
1111-// TODO: should probably move this to a 'mockdirectory' sub-package?
1010+// A fake identity directory, for use in tests
1211type MockDirectory struct {
1312 Handles map[syntax.Handle]syntax.DID
1413 Identities map[syntax.DID]Identity
···6160 }
6261 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID")
6362}
6363+6464+func (d *MockDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error {
6565+ return nil
6666+}