VDR: Refactor types and didservice packages #2513
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces #2471
Goals of this PR are:
types
package, since packages should imply function, not technical contentsdidservice
package, since it's a dumping place for every "service"-y type that doesn't fit anywhere else. And the same argument as fortypes
applies here as well.Changes:
vdr/didservice/common.go#CompoundService
(type alias formap[string]string
), was just used indidman.go
vdr/didservice/common.go#ErrDIDAlreadyExists
(unused)vdr/didservice/test.go
(unused)vdr/types
andvdr/didservice
tovdr/resolvers/did.go
. The same for keys and services.vdr/didservice#KeyResolver
implementation toDIDKeyResolver
(otherwise it clashes with the interface name).vdr/didservice#ServiceResolver
implementation toDIDServiceResolver
(otherwise it clashes with the interface name).vdr/didservice
tovdr/management/management.go
vdr/management/finder.go
VDR
toModule
, to avoid clash with the interface name (later on, theVDR
interface should be renamed as well, since packages shouldn't contain types which starts with the same word or are named the same). We could do this for all module implementations, for consistency.No functionality or behavior has been changed/removed.