vdr

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockVDR

type MockVDR struct {
	AcceptValue bool
	StoreErr    error
	ReadFunc    func(didID string, opts ...vdrapi.ResolveOpts) (*did.Doc, error)
	BuildFunc   func(pubKey *vdrapi.PubKey, opts ...vdrapi.DocOpts) (*did.Doc, error)
	CloseErr    error
}

MockVDR mock implementation of vdr to be used only for unit tests.

func (*MockVDR) Accept

func (m *MockVDR) Accept(method string) bool

Accept did.

func (*MockVDR) Build

func (m *MockVDR) Build(pubKey *vdrapi.PubKey, opts ...vdrapi.DocOpts) (*did.Doc, error)

Build did.

func (*MockVDR) Close

func (m *MockVDR) Close() error

Close frees resources being maintained by vdr.

func (*MockVDR) Read

func (m *MockVDR) Read(didID string, opts ...vdrapi.ResolveOpts) (*did.Doc, error)

Read did.

func (*MockVDR) Store

func (m *MockVDR) Store(doc *did.Doc, by *[]vdrapi.ModifiedBy) error

Store did.

type MockVDRegistry

type MockVDRegistry struct {
	CreateErr    error
	CreateValue  *did.Doc
	CreateFunc   func(string, ...vdrapi.DocOpts) (*did.Doc, error)
	MemStore     map[string]*did.Doc
	StoreFunc    func(*did.Doc) error
	PutErr       error
	ResolveErr   error
	ResolveValue *did.Doc
	ResolveFunc  func(didID string, opts ...vdrapi.ResolveOpts) (*did.Doc, error)
}

MockVDRegistry mock implementation of vdr to be used only for unit tests.

func (*MockVDRegistry) Close

func (m *MockVDRegistry) Close() error

Close frees resources being maintained by vdr.

func (*MockVDRegistry) Create

func (m *MockVDRegistry) Create(method string, opts ...vdrapi.DocOpts) (*did.Doc, error)

Create mock implementation of create DID.

func (*MockVDRegistry) Resolve

func (m *MockVDRegistry) Resolve(didID string, opts ...vdrapi.ResolveOpts) (*did.Doc, error)

Resolve did document.

func (*MockVDRegistry) Store

func (m *MockVDRegistry) Store(doc *did.Doc) error

Store stores the key and the record.

Jump to

Keyboard shortcuts

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