memstorage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package memstorage contains a credential storage implementation using in-memory storage only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

A Provider allows for credential storage and retrieval using in-memory storage only.

func NewProvider

func NewProvider() *Provider

NewProvider returns a new Provider.

func (*Provider) Add

func (p *Provider) Add(vc *verifiable.Credential) error

Add stores the given credential.

func (*Provider) Get

func (p *Provider) Get(id string) (*verifiable.Credential, error)

Get returns a credential with the given id. An error is returned if no credential exists with the given id.

func (*Provider) GetAll

func (p *Provider) GetAll() ([]verifiable.Credential, error)

GetAll returns all stored credentials.

func (*Provider) Remove

func (p *Provider) Remove(id string) error

Remove removes the credential with the matching id, if it exists.

Jump to

Keyboard shortcuts

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