TBD54566975 / web5-go

Apache License 2.0
10 stars 6 forks source link

Create common resolver interface #14

Closed mihai-chiorean closed 7 months ago

mihai-chiorean commented 7 months ago

Summary

This introduces the idea of an interface for the resolver and both jwk and dht implement the .Resolve(did string) interface. It makes the calls to the underlying resolvers more clean and apart from adding new methods, the resolution part should just work with no additional changes.

The PR still keeps a default resolver implementation available.

Caveats

DHT needs a little more context to resolve (a relay and an http client). JWK does not. In the PR the JWKResolver is an empty struct that is set up mainly to be able to implement the pattern/interface and has no real benefit right now.