vdr

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode is typically a code for invalid requests.
	InvalidRequestErrorCode = command.Code(iota + command.VDR)

	// SaveDIDErrorCode for save did error.
	SaveDIDErrorCode

	// GetDIDErrorCode for get did error.
	GetDIDErrorCode

	// ResolveDIDErrorCode for get did error.
	ResolveDIDErrorCode

	// CreateDIDErrorCode for create did error.
	CreateDIDErrorCode
)

Error codes.

View Source
const (
	// command name.
	CommandName = "vdr"

	// command methods.
	SaveDIDCommandMethod    = "SaveDID"
	GetDIDsCommandMethod    = "GetDIDRecords"
	GetDIDCommandMethod     = "GetDID"
	ResolveDIDCommandMethod = "ResolveDID"
	CreateDIDCommandMethod  = "CreateDID"
)

constants for the VDR controller's methods.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

Command contains command operations provided by vdr controller.

func New

func New(ctx provider) (*Command, error)

New returns new vdr controller command instance.

func (*Command) CreateDID added in v0.1.7

func (o *Command) CreateDID(rw io.Writer, req io.Reader) command.Error

CreateDID create did.

func (*Command) GetDID

func (o *Command) GetDID(rw io.Writer, req io.Reader) command.Error

GetDID retrieves the did from the store.

func (*Command) GetDIDRecords

func (o *Command) GetDIDRecords(rw io.Writer, req io.Reader) command.Error

GetDIDRecords retrieves the did doc containing name and didID. //TODO Add pagination feature #1566.

func (*Command) GetHandlers

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

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

func (*Command) ResolveDID

func (o *Command) ResolveDID(rw io.Writer, req io.Reader) command.Error

ResolveDID resolve did.

func (*Command) SaveDID

func (o *Command) SaveDID(rw io.Writer, req io.Reader) command.Error

SaveDID saves the did doc to the store.

type CreateDIDRequest added in v0.1.7

type CreateDIDRequest struct {
	Method string                 `json:"method,omitempty"`
	DID    json.RawMessage        `json:"did,omitempty"`
	Opts   map[string]interface{} `json:"opts,omitempty"`
}

CreateDIDRequest is model for create did request.

type DIDArgs

type DIDArgs struct {
	Document
	Name string `json:"name,omitempty"`
}

DIDArgs is model for did doc with fields related to command features.

type DIDRecordResult

type DIDRecordResult struct {
	// Result
	Result []*storeDID.Record `json:"result,omitempty"`
}

DIDRecordResult holds the did doc records.

type Document

type Document struct {
	DID json.RawMessage `json:"did,omitempty"`
}

Document is model for did document.

type IDArg

type IDArg struct {
	// DidID
	ID string `json:"id"`
}

IDArg model

This is used for querying/removing by did ID from input json.

type NameArg

type NameArg struct {
	// Name
	Name string `json:"name"`
}

NameArg model

This is used for querying by did name from input json.

Jump to

Keyboard shortcuts

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