storage

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package storage includes sample implementations of different store mechanisms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ephemeral

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

Ephemeral provides an in-memory store for development and testing.

func (*Ephemeral) Close

func (e *Ephemeral) Close() error

Close will release used-memory.

func (*Ephemeral) Delete

func (e *Ephemeral) Delete(id *did.Identifier) error

Delete any existing record for the provided DID instance.

func (*Ephemeral) Description

func (e *Ephemeral) Description() string

Description returns a brief summary for the storage instance.

func (*Ephemeral) Exists

func (e *Ephemeral) Exists(id *did.Identifier) bool

Exists returns true if the provided DID instance is already available in the store.

func (*Ephemeral) Get

Get a previously stored DID instance.

func (*Ephemeral) Open

func (e *Ephemeral) Open(_ string) error

Open is a no-op for the ephemeral store. As an example just setup internally used structures.

func (*Ephemeral) Save

func (e *Ephemeral) Save(id *did.Identifier, proof *did.ProofLD) (string, error)

Save will create or update an entry for the provided DID instance.

type IPFS

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

IPFS provides an integration with the "InterPlanetary File System", a decentralized global storage mechanism.

func (*IPFS) Close

func (c *IPFS) Close() error

Close the storage instance and free any resources in use.

func (*IPFS) Delete

func (c *IPFS) Delete(_ *did.Identifier) error

Delete any existing records for the given DID instance.

func (*IPFS) Description

func (c *IPFS) Description() string

Description of the storage instance.

func (*IPFS) Exists

func (c *IPFS) Exists(id *did.Identifier) bool

Exists will check if a record exists for the specified DID.

func (*IPFS) Get

func (c *IPFS) Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)

Get a previously stored DID instance.

func (*IPFS) Open

func (c *IPFS) Open(addr string) error

Open a connection with provided IPFS daemon instance.

func (*IPFS) Save

func (c *IPFS) Save(id *did.Identifier, proof *did.ProofLD) (string, error)

Save the record for the given DID instance.

type MongoStore

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

MongoStore provides a storage handler utilizing MongoDB as underlying database.

func (*MongoStore) Close

func (ms *MongoStore) Close() error

Close the client connection with the backend server.

func (*MongoStore) Delete

func (ms *MongoStore) Delete(id *did.Identifier) error

Delete any existing record for the provided DID instance.

func (*MongoStore) Description

func (ms *MongoStore) Description() string

Description returns a brief summary for the storage instance.

func (*MongoStore) Exists

func (ms *MongoStore) Exists(id *did.Identifier) bool

Exists returns true if the provided DID instance is already available in the store.

func (*MongoStore) Get

Get a previously stored DID instance.

func (*MongoStore) Open

func (ms *MongoStore) Open(info string) error

Open establish the connection and database selection for the instance. Must be called before any further operations. 'info' must be a valid connection string of the form "mongodb://..."; for example: "mongodb://localhost:27017"

func (*MongoStore) Save

func (ms *MongoStore) Save(id *did.Identifier, proof *did.ProofLD) (string, error)

Save will create or update an entry for the provided DID instance.

Jump to

Keyboard shortcuts

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