Skip to content

Commit

Permalink
#20: Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pdt256 committed May 10, 2021
1 parent 3d38a94 commit e80cfc2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/crypto/cryptotest/failing_event_encryptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

type failingEventEncryptor struct{}

// NewFailingEventEncryptor always errors on Encrypt/Decrypt
func NewFailingEventEncryptor() *failingEventEncryptor {
return &failingEventEncryptor{}
}
Expand Down
1 change: 1 addition & 0 deletions provider/encryptedstore/decrypting_record_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type decryptingRecordSubscriber struct {
eventEncryptor crypto.EventEncryptor
}

// NewDecryptingRecordSubscriber decrypts records on Accept
func NewDecryptingRecordSubscriber(parent rangedb.RecordSubscriber, eventEncryptor crypto.EventEncryptor) *decryptingRecordSubscriber {
return &decryptingRecordSubscriber{
parent: parent,
Expand Down
5 changes: 3 additions & 2 deletions provider/encryptedstore/encrypted_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ type encryptedStore struct {
eventEncryptor crypto.EventEncryptor
}

func New(parentStore rangedb.Store, eventEncryptor crypto.EventEncryptor) *encryptedStore {
// New constructs an Encrypted Store that automatically encrypts/decrypts events for a decorated parent rangedb.Store.
func New(parent rangedb.Store, eventEncryptor crypto.EventEncryptor) *encryptedStore {
return &encryptedStore{
parent: parentStore,
parent: parent,
eventEncryptor: eventEncryptor,
}
}
Expand Down

0 comments on commit e80cfc2

Please sign in to comment.