didclient

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Overview

Package didclient provides did commands.

Index

Constants

View Source
const (
	// CommandName package command name.
	CommandName = "didclient"
	// CreateTrustBlocDIDCommandMethod command method.
	CreateTrustBlocDIDCommandMethod = "CreateTrustBlocDID"
	// CreatePeerDIDCommandMethod command method.
	CreatePeerDIDCommandMethod = "CreatePeerDID"
)
View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors.
	InvalidRequestErrorCode = command.Code(iota + command.DIDClient)

	// CreateDIDErrorCode is typically a code for create did errors.
	CreateDIDErrorCode
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command is controller command for DID Exchange.

func New

func New(domain string, p Provider) (*Command, error)

New returns new DID Exchange controller command instance.

func (*Command) CreatePeerDID

func (c *Command) CreatePeerDID(rw io.Writer, req io.Reader) command.Error

CreatePeerDID creates a new peer DID.

func (*Command) CreateTrustBlocDID

func (c *Command) CreateTrustBlocDID(rw io.Writer, req io.Reader) command.Error

CreateTrustBlocDID creates a new trust bloc DID.

func (*Command) GetHandlers

func (c *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command.

type CreateBlocDIDRequest

type CreateBlocDIDRequest struct {
	PublicKeys []PublicKey `json:"publicKeys,omitempty"`
}

CreateBlocDIDRequest model

This is used for creating trustbloc DID

type CreateDIDResponse

type CreateDIDResponse struct {
	DID json.RawMessage
}

CreateDIDResponse contains the newly-create DID doc.

type CreatePeerDIDRequest

type CreatePeerDIDRequest struct {
	RouterConnectionID string `json:"routerConnectionID,omitempty"`
}

CreatePeerDIDRequest model

This is used for creating peer DID

type Provider

type Provider interface {
	VDRegistry() vdr.Registry
	Service(id string) (interface{}, error)
}

Provider describes dependencies for the client.

type PublicKey

type PublicKey struct {
	ID       string   `json:"id,omitempty"`
	Type     string   `json:"type,omitempty"`
	Encoding string   `json:"encoding,omitempty"`
	KeyType  string   `json:"keyType,omitempty"`
	Purposes []string `json:"purposes,omitempty"`
	Recovery bool     `json:"recovery,omitempty"`
	Update   bool     `json:"update,omitempty"`
	Value    string   `json:"value,omitempty"`
}

PublicKey public key.

Jump to

Keyboard shortcuts

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