this repo has no description
0
fork

Configure Feed

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

add Resolve* methods to Directory interface

+11 -4
+11 -4
atproto/identity/directory.go
··· 10 10 "github.com/bluesky-social/indigo/atproto/syntax" 11 11 ) 12 12 13 - // API for doing account lookups by DID or handle, with bi-directional verification handled automatically. Almost all atproto services and clients should use an implementation of this interface instead of resolving handles or DIDs separately 13 + // Common for doing atproto identity lookups by DID or handle. 14 + // 15 + // The "Lookup" methods do bi-directional handle verification automatically, and format results in a compact atproto-specific struct ("Identity"). Clients and services should use these methods by default, instead of resolving handles or DIDs separately. 14 16 // 15 17 // Handles which fail to resolve, or don't match DID alsoKnownAs, are an error. DIDs which resolve but the handle does not resolve back to the DID return an Identity where the Handle is the special `handle.invalid` value. 16 18 // 19 + // The "Resolve" methods do direct resolution of just the identifier indicated. 20 + // 17 21 // Some example implementations of this interface could be: 18 22 // - basic direct resolution on every call 19 23 // - local in-memory caching layer to reduce network hits 20 24 // - API client, which just makes requests to PDS (or other remote service) 21 25 // - client for shared network cache (eg, Redis) 22 26 type Directory interface { 23 - LookupHandle(ctx context.Context, h syntax.Handle) (*Identity, error) 24 - LookupDID(ctx context.Context, d syntax.DID) (*Identity, error) 25 - Lookup(ctx context.Context, i syntax.AtIdentifier) (*Identity, error) 27 + LookupHandle(ctx context.Context, hdl syntax.Handle) (*Identity, error) 28 + LookupDID(ctx context.Context, did syntax.DID) (*Identity, error) 29 + Lookup(ctx context.Context, atid syntax.AtIdentifier) (*Identity, error) 30 + 31 + ResolveDID(ctx context.Context, did syntax.DID) (*DIDDocument, error) 32 + ResolveHandle(ctx context.Context, handle syntax.Handle) (syntax.DID, error) 26 33 27 34 // Flushes any cache of the indicated identifier. If directory is not using caching, can ignore this. 28 35 Purge(ctx context.Context, i syntax.AtIdentifier) error