this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

identity: add purge method to interface

+17 -3
+4
atproto/identity/base_directory.go
··· 85 85 } 86 86 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID") 87 87 } 88 + 89 + func (d *BaseDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error { 90 + return nil 91 + }
+5
atproto/identity/cache_directory.go
··· 203 203 } 204 204 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID") 205 205 } 206 + 207 + // XXX: 208 + func (d *CacheDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error { 209 + return nil 210 + }
+3 -1
atproto/identity/identity.go
··· 29 29 LookupHandle(ctx context.Context, h syntax.Handle) (*Identity, error) 30 30 LookupDID(ctx context.Context, d syntax.DID) (*Identity, error) 31 31 Lookup(ctx context.Context, i syntax.AtIdentifier) (*Identity, error) 32 - // TODO: add "flush" methods to purge caches? 32 + 33 + // Flushes any cache of the indicated identifier. If directory is not using caching, can ignore this. 34 + Purge(ctx context.Context, i syntax.AtIdentifier) error 33 35 } 34 36 35 37 // Indicates that resolution process completed successfully, but handle does not exist.
+5 -2
atproto/identity/mock_directory.go
··· 7 7 "github.com/bluesky-social/indigo/atproto/syntax" 8 8 ) 9 9 10 - // A fake identity directory , for use in tests 11 - // TODO: should probably move this to a 'mockdirectory' sub-package? 10 + // A fake identity directory, for use in tests 12 11 type MockDirectory struct { 13 12 Handles map[syntax.Handle]syntax.DID 14 13 Identities map[syntax.DID]Identity ··· 61 60 } 62 61 return nil, fmt.Errorf("at-identifier neither a Handle nor a DID") 63 62 } 63 + 64 + func (d *MockDirectory) Purge(ctx context.Context, a syntax.AtIdentifier) error { 65 + return nil 66 + }