Documentation
¶
Overview ¶
Package storage includes sample implementations of different store mechanisms.
Index ¶
- func NotFoundError(req *protov1.QueryRequest) error
- 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) 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) error
- type NotFound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotFoundError ¶
func NotFoundError(req *protov1.QueryRequest) error
NotFoundError is a utility function returning an error instance that indicates a resolve request target's doesn't exist.
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 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 MongoDB connection string, optionally followed by a database identifier; for example: `mongodb://localhost:27017|my_db`. https://www.mongodb.com/docs/manual/reference/connection-string/
func (*MongoStore) Save ¶
func (ms *MongoStore) Save(id *did.Identifier, proof *did.ProofLD) error
Save will create or update an entry for the provided DID instance.