Documentation ¶
Overview ¶
Package agent provides a reference implementation for a DID network management process.
Index ¶
- type Handler
- func (h *Handler) AccountActivity(ctx context.Context, req *protoV1.AccountActivityRequest) (<-chan *protoV1.AccountActivityResponse, error)
- func (h *Handler) AccountInformation(ctx context.Context, req *protoV1.AccountInformationRequest) (*protoV1.AccountInformationResponse, error)
- func (h *Handler) Close() error
- func (h *Handler) GatewaySetup() rpc.GatewayRegisterFunc
- func (h *Handler) Process(req *protoV1.ProcessRequest) (string, error)
- func (h *Handler) QueryResponseFilter() rpc.GatewayInterceptor
- func (h *Handler) Retrieve(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
- func (h *Handler) ServerSetup(server *grpc.Server)
- func (h *Handler) TxParameters(ctx context.Context) (*protoV1.TxParametersResponse, error)
- func (h *Handler) TxSubmit(ctx context.Context, req *protoV1.TxSubmitRequest) (*protoV1.TxSubmitResponse, error)
- type HandlerOptions
- type Storage
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(options HandlerOptions) (*Handler, error)
NewHandler starts a new DID method handler instance.
func (*Handler) AccountActivity ¶
func (h *Handler) AccountActivity(ctx context.Context, req *protoV1.AccountActivityRequest) (<-chan *protoV1.AccountActivityResponse, error)
AccountActivity opens a channel to monitor near real-time account activity. The channel must be closed using the provided context when no longer needed.
func (*Handler) AccountInformation ¶
func (h *Handler) AccountInformation(ctx context.Context, req *protoV1.AccountInformationRequest) (*protoV1.AccountInformationResponse, error)
AccountInformation returns details about the crypto account specified.
func (*Handler) GatewaySetup ¶ added in v0.3.0
func (h *Handler) GatewaySetup() rpc.GatewayRegisterFunc
GatewaySetup return the HTTP setup method to allow exposing the handler's functionality through an HTTP gateway.
func (*Handler) Process ¶
func (h *Handler) Process(req *protoV1.ProcessRequest) (string, error)
Process an incoming request ticket.
func (*Handler) QueryResponseFilter ¶
func (h *Handler) QueryResponseFilter() rpc.GatewayInterceptor
QueryResponseFilter provides custom encoding of HTTP query results.
func (*Handler) Retrieve ¶
func (h *Handler) Retrieve(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
Retrieve an existing DID instance based on its subject string.
func (*Handler) ServerSetup ¶ added in v0.3.0
ServerSetup performs all initialization requirements for the handler instance to be exposed through the provided gRPC server.
func (*Handler) TxParameters ¶
TxParameters return the latest network parameters suggested for processing new transactions.
func (*Handler) TxSubmit ¶
func (h *Handler) TxSubmit(ctx context.Context, req *protoV1.TxSubmitRequest) (*protoV1.TxSubmitResponse, error)
TxSubmit will send a signed raw transaction to the network for processing.
type HandlerOptions ¶
type HandlerOptions struct { // Supported DID methods. Methods []string // PoW difficulty level required for valid transactions. Difficulty uint // Storage mechanism to be used for persistent state. Store Storage // Observability operator. OOP *otel.Operator // Algorand node client. AlgoNode *algod.Client // Algorand indexer client. AlgoIndexer *indexer.Client }
HandlerOptions defines the settings available to adjust the operation of a handler instance.
type Storage ¶
type Storage interface { // Setup the instance and prepare for usage. Open(info string) error // Free resources and finish processing. Close() error // Returns a brief information summary for the storage instance. Description() string // Check if a record exists for the specified DID. Exists(id *did.Identifier) bool // Return a previously stored DID instance. Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error) // Create or update the record for the given DID instance. Save(id *did.Identifier, proof *did.ProofLD) (string, error) // Remove 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.