types

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIDSchemaJSONLD = "https://www.w3.org/ns/did/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Listener     string
	ResolverPath string
}

type Config

type Config struct {
	Ledger   LedgerConfig
	Resolver ResolverConfig
	Api      ApiConfig

	LogLevel string
}

func (*Config) MarshalJson

func (c *Config) MarshalJson() (string, error)

func (*Config) MarshalYaml

func (c *Config) MarshalYaml() (string, error)

func (*Config) MustMarshalJson

func (c *Config) MustMarshalJson() string

func (*Config) MustMarshalYaml

func (c *Config) MustMarshalYaml() string

type ContentType

type ContentType string
const (
	DIDJSON   ContentType = "application/did+json"
	DIDJSONLD ContentType = "application/did+ld+json"
	JSONLD    ContentType = "application/ld+json"
	HTML      ContentType = "text/html"
)

type DereferencedResource

type DereferencedResource struct {
	Context           []string `json:"@context,omitempty"`
	CollectionId      string   `json:"collectionId,omitempty"`
	Id                string   `json:"id,omitempty"`
	Name              string   `json:"name,omitempty"`
	ResourceType      string   `json:"resourceType,omitempty"`
	MediaType         string   `json:"mediaType,omitempty"`
	Created           string   `json:"created,omitempty"`
	Checksum          []byte   `json:"checksum,omitempty"`
	PreviousVersionId string   `json:"previousVersionId,omitempty"`
	NextVersionId     string   `json:"nextVersionId,omitempty"`
	Data              []byte   `json:"data,omitempty"`
}

type DereferencingMetadata

type DereferencingMetadata ResolutionMetadata

func NewDereferencingMetadata

func NewDereferencingMetadata(did string, contentType ContentType, resolutionError ErrorType) DereferencingMetadata

type DereferencingOption

type DereferencingOption ResolutionOption

type DidDereferencing

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

type DidProperties

type DidProperties struct {
	DidString        string `json:"didString,omitempty"`
	MethodSpecificId string `json:"methodSpecificId,omitempty"`
	Method           string `json:"method,omitempty"`
}

type DidResolution

type DidResolution struct {
	Did                cheqd.Did          `json:"didDocument,omitempty"`
	Metadata           cheqd.Metadata     `json:"didDocumentMetadata,omitempty"`
	ResolutionMetadata ResolutionMetadata `json:"didResolutionMetadata,omitempty"`
}

type ErrorType

type ErrorType string
const (
	ResolutionInvalidDID         ErrorType = "invalidDid"
	ResolutionNotFound           ErrorType = "notFound"
	ResolutionMethodNotSupported ErrorType = "methodNotSupported"
)
const (
	DereferencingInvalidDIDUrl ErrorType = "invalidDidUrl"
	DereferencingNotFound      ErrorType = "notFound"
	DereferencingNotSupported  ErrorType = "urlNotSupported"
)

type LedgerConfig

type LedgerConfig struct {
	Networks string
	Timeout  time.Duration
	UseTls   bool
}

type ResolutionMetadata

type ResolutionMetadata struct {
	ContentType     ContentType   `json:"contentType,omitempty"`
	ResolutionError ErrorType     `json:"error,omitempty"`
	Retrieved       string        `json:"retrieved,omitempty"`
	DidProperties   DidProperties `json:"did,omitempty"`
}

func NewResolutionMetadata

func NewResolutionMetadata(didUrl string, contentType ContentType, resolutionError ErrorType) ResolutionMetadata

type ResolutionOption

type ResolutionOption struct {
	Accept ContentType `json:"accept,omitempty"`
}

type ResolverConfig

type ResolverConfig struct {
	Method string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL