indy

package module
v0.0.0-...-1a43f7c Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package indy implements a VDR interface for Aries (aries-framework-go).

Index

Constants

View Source
const (
	// DefaultServiceType default service type.
	DefaultServiceType = "defaultServiceType"
	// DefaultServiceEndpoint default service endpoint.
	DefaultServiceEndpoint = "defaultServiceEndpoint"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetNym(did string) (*vdr.ReadReply, error)
	GetEndpoint(did string) (*vdr.ReadReply, error)
	GetPoolStatus() (*vdr.PoolStatus, error)
	RefreshPool() error
	Close() error
}

Client is the API for interacting with the Indy VDR client.

type Option

type Option func(opts *VDR)

Option configures the Indy vdri.

func WithIndyClient

func WithIndyClient(client Client) Option

WithIndyClient configures the VDR with an existing Indy Client.

func WithIndyVDRGenesisFile

func WithIndyVDRGenesisFile(genesisFile string) Option

WithIndyVDRGenesisFile configures the VDR with a genesis file.

func WithIndyVDRGenesisReader

func WithIndyVDRGenesisReader(genesisData io.ReadCloser) Option

WithIndyVDRGenesisReader configures the VDR with a genesis reader.

func WithRefresh

func WithRefresh(refresh bool) Option

WithRefresh option configuring an initial refresh of the Indy pool.

type VDR

type VDR struct {
	MethodName string
	Refresh    bool
	Client     Client
}

VDR represents a Verifiable Data Registry for use with Indy ledgers.

func New

func New(methodName string, opts ...Option) (*VDR, error)

New creates an instance of an Indy VDR.

func (*VDR) Accept

func (v *VDR) Accept(method string) bool

Accept the did method.

func (*VDR) Close

func (v *VDR) Close() error

Close the client connection.

func (*VDR) Create

func (v *VDR) Create(didDoc *did.Doc, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error)

Create builds a new DID Doc.

func (*VDR) Deactivate

func (v *VDR) Deactivate(did string, opts ...vdrapi.DIDMethodOption) error

Deactivate did doc.

func (*VDR) Read

func (v *VDR) Read(did string, opts ...vdrapi.DIDMethodOption) (*diddoc.DocResolution, error)

func (*VDR) Update

func (v *VDR) Update(didDoc *diddoc.Doc, opts ...vdrapi.DIDMethodOption) error

Update did doc.

Directories

Path Synopsis
Package mock contains mocks for testing against Indy VDR.
Package mock contains mocks for testing against Indy VDR.

Jump to

Keyboard shortcuts

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