Skip to content

Commit

Permalink
DEV-1172: Add data models
Browse files Browse the repository at this point in the history
  • Loading branch information
Toktar committed Apr 20, 2022
1 parent b73fa75 commit 6943dab
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
21 changes: 21 additions & 0 deletions types/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package types

type ResolutionError string

const (
ResolutionInvalidDID ResolutionError = "invalidDid"
ResolutionNotFound ResolutionError = "notFound"
ResolutionMethodNotSupported ResolutionError = "methodNotSupported"
)

type ContentType string

const (
DIDJSON ContentType = "application/did+json"
DIDJSONLD ContentType = "application/did+ld+json"
JSONLD ContentType = "application/ld+json"
)

const (
DIDSchemaJSONLD = "https://ww.w3.org/ns/did/v1"
)
19 changes: 19 additions & 0 deletions types/dereverecing_metadata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package types

import (
cheqd "github.com/cheqd/cheqd-node/x/cheqd/types"
)

type DereferencingOption ResolutionOption

type DereferencingMetadata ResolutionMetadata

type DidDereferencing struct {
ContentStream interface{} `json:"contentStream,omitempty"`
Metadata cheqd.Metadata `json:"contentMetadata,omitempty"`
ResolutionMetadata DereferencingMetadata `json:"DereferencingMetadata,omitempty"`
}

func NewDereferencingMetadata(did string, contentType ContentType, resolutionError ResolutionError) DereferencingMetadata {
return DereferencingMetadata(NewResolutionMetadata(did, contentType, resolutionError))
}

0 comments on commit 6943dab

Please sign in to comment.