agent

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package agent provides a reference implementation for a DID network management process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler provides the required functionality for the DID method.

func NewHandler

func NewHandler(methods []string, difficulty uint, store Storage, oop *otel.Operator) (*Handler, error)

NewHandler starts a new DID method handler instance.

func (*Handler) Close

func (h *Handler) Close() error

Close the instance and safely terminate any internal processing.

func (*Handler) CustomGatewayOptions added in v0.9.0

func (h *Handler) CustomGatewayOptions() []rpc.GatewayOption

CustomGatewayOptions returns additional settings required when exposing the handler instance via HTTP.

func (*Handler) GatewaySetup added in v0.9.0

func (h *Handler) GatewaySetup() rpc.GatewayRegisterFunc

GatewaySetup return the HTTP setup required to expose the handler instance via HTTP.

func (*Handler) Process

func (h *Handler) Process(ctx context.Context, req *protov1.ProcessRequest) (err error)

Process an incoming request ticket.

func (*Handler) Retrieve

func (h *Handler) Retrieve(ctx context.Context, req *protov1.QueryRequest) (*did.Identifier, *did.ProofLD, error)

Retrieve an existing DID instance based on its subject string.

func (*Handler) ServerSetup added in v0.9.0

func (h *Handler) ServerSetup(srv *grpc.Server)

ServerSetup perform all initialization requirements for the handler instance to be exposed through the provided gRPC server.

type Storage

type Storage interface {
	// Open will prepare the instance for usage.
	Open(info string) error

	// Close the storage instance, free resources and finish processing.
	Close() error

	// Description returns a brief information summary for the storage instance.
	Description() string

	// Exists will check if a record exists for the specified DID.
	Exists(id *did.Identifier) bool

	// Get will return a previously stored DID instance.
	Get(req *protov1.QueryRequest) (*did.Identifier, *did.ProofLD, error)

	// Save or update the record for the given DID instance.
	Save(id *did.Identifier, proof *did.ProofLD) error

	// Delete any existing records for the given DID instance.
	Delete(id *did.Identifier) error
}

Storage defines an abstract component that provides and manage persistent data requirements for DID documents.

Directories

Path Synopsis
Package storage includes sample implementations of different store mechanisms.
Package storage includes sample implementations of different store mechanisms.

Jump to

Keyboard shortcuts

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