Documentation ¶
Overview ¶
Package storage includes sample implementations of different store mechanisms.
Index ¶
- type Ephemeral
- func (e *Ephemeral) Close() error
- func (e *Ephemeral) Delete(id *did.Identifier) error
- func (e *Ephemeral) Description() string
- func (e *Ephemeral) Exists(id *did.Identifier) bool
- func (e *Ephemeral) Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
- func (e *Ephemeral) Open(_ string) error
- func (e *Ephemeral) Save(id *did.Identifier, proof *did.ProofLD) (string, error)
- type IPFS
- func (c *IPFS) Close() error
- func (c *IPFS) Delete(_ *did.Identifier) error
- func (c *IPFS) Description() string
- func (c *IPFS) Exists(id *did.Identifier) bool
- func (c *IPFS) Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
- func (c *IPFS) Open(addr string) error
- func (c *IPFS) Save(id *did.Identifier, proof *did.ProofLD) (string, error)
- type MongoStore
- func (ms *MongoStore) Close() error
- func (ms *MongoStore) Delete(id *did.Identifier) error
- func (ms *MongoStore) Description() string
- func (ms *MongoStore) Exists(id *did.Identifier) bool
- func (ms *MongoStore) Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
- func (ms *MongoStore) Open(info string) error
- func (ms *MongoStore) Save(id *did.Identifier, proof *did.ProofLD) (string, error)
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) Delete ¶
func (e *Ephemeral) Delete(id *did.Identifier) error
Delete any existing record for the provided DID instance.
func (*Ephemeral) Description ¶
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 ¶
func (e *Ephemeral) Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
Get a previously stored 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) Delete ¶
func (c *IPFS) Delete(_ *did.Identifier) error
Delete any existing records for the given DID 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.
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 ¶
func (ms *MongoStore) Get(req *protoV1.QueryRequest) (*did.Identifier, *did.ProofLD, error)
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.