ion

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_URL string = "http://localhost:3000/"
View Source
const IDENTIFIERS_URL string = "identifiers"
View Source
const OPERATIONS_URL string = "operations"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ResolveDid(didstr string) ([]byte, error)
	UpdateDid(req interface{}) ([]byte, error)
}

func NewClient

func NewClient(cfg *ClientConfig) Client

type ClientConfig

type ClientConfig struct {
	Url string
}

type CreateRequest

type CreateRequest struct {
	Type       string     `json:"type"`
	SuffixData SuffixData `json:"suffixData"`
	Delta      Delta      `json:"delta"`
}

Create Request

type Delta

type Delta struct {
	Patches          []Patches `json:"patches"`
	UpdateCommitment string    `json:"updateCommitment"`
}

type DidDocument

type DidDocument struct {
	ID                 string               `json:"id"`
	Context            []interface{}        `json:"@context"`
	Service            []Service            `json:"service"`
	VerificationMethod []VerificationMethod `json:"verificationMethod"`
	Authentication     []string             `json:"authentication"`
}

TODO remove in favor of real type

type DidDocumentMetadata

type DidDocumentMetadata struct {
	Method      Method `json:"method"`
	CanonicalID string `json:"canonicalId"`
}

type Document

type Document struct {
	PublicKeys []PublicKeys `json:"publicKeys,omitempty"`
	Services   []Services   `json:"services,omitempty"`
}

type IonError

type IonError struct {
	Message string `json:"message"`
	Code    string `json:"code"`
}

type Method

type Method struct {
	Published          bool   `json:"published"`
	RecoveryCommitment string `json:"recoveryCommitment"`
	UpdateCommitment   string `json:"updateCommitment"`
}

type Patches

type Patches struct {
	Action     string       `json:"action"`
	Services   []Services   `json:"services,omitempty"`
	PublicKeys []PublicKeys `json:"publicKeys,omitempty"`
	Ids        []string     `json:"ids,omitempty"`
	Document   *Document    `json:"document,omitempty"`
}

type PublicKeyJwk

type PublicKeyJwk struct {
	Kty string `json:"kty"`
	Crv string `json:"crv"`
	X   string `json:"x"`
	Y   string `json:"y"`
}

type PublicKeys

type PublicKeys struct {
	ID           string   `json:"id"`
	Type         string   `json:"type"`
	PublicKeyJwk jwk.JWK  `json:"publicKeyJwk"`
	Purposes     []string `json:"purposes"`
}

type ResolveDidResponse

type ResolveDidResponse struct {
	Context             string              `json:"@context"`
	DidDocument         DidDocument         `json:"didDocument"`
	DidDocumentMetadata DidDocumentMetadata `json:"didDocumentMetadata"`
}

ResolveDid Response

type Service

type Service struct {
	ID              string `json:"id"`
	Type            string `json:"type"`
	ServiceEndpoint string `json:"serviceEndpoint"`
}

type Services

type Services struct {
	ID              string `json:"id"`
	Type            string `json:"type"`
	ServiceEndpoint string `json:"serviceEndpoint"` // TODO in ION this can be an object
}

type SuffixData

type SuffixData struct {
	DeltaHash          string `json:"deltaHash"`
	RecoveryCommitment string `json:"recoveryCommitment"`
}

type UpdateDataToSign

type UpdateDataToSign struct {
	UpdateKey *jwk.JWK `json:"updateKey"`
	DeltaHash string   `json:"deltaHash"`
}

type UpdateRequest

type UpdateRequest struct {
	Type        string `json:"type"`
	DidSuffix   string `json:"didSuffix"`
	RevealValue string `json:"revealValue"`
	Delta       Delta  `json:"delta"`
	SignedData  string `json:"signedData"`
}

Consolidate with Create Request Update Request

type VerificationMethod

type VerificationMethod struct {
	ID           string       `json:"id"`
	Controller   string       `json:"controller"`
	Type         string       `json:"type"`
	PublicKeyJwk PublicKeyJwk `json:"publicKeyJwk"`
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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