-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addition of a NULL Backend to provide a simple way of disabling backend
lookups
- Loading branch information
1 parent
bbd6729
commit d2451a0
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package store | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
var _ Store = &NullStore{} | ||
|
||
type NullStore struct{} | ||
|
||
func NewNullStore() *NullStore { | ||
return &NullStore{} | ||
} | ||
|
||
func (s *NullStore) Write(id SecretId, value string) error { | ||
return errors.New("Write is not implemented for Null Store") | ||
} | ||
|
||
func (s *NullStore) Read(id SecretId, version int) (Secret, error) { | ||
return Secret{}, errors.New("Not implemented for Null Store") | ||
} | ||
|
||
func (s *NullStore) List(service string, includeValues bool) ([]Secret, error) { | ||
return []Secret{}, nil | ||
} | ||
|
||
func (s *NullStore) ListRaw(service string) ([]RawSecret, error) { | ||
return []RawSecret{}, nil | ||
} | ||
|
||
func (s *NullStore) History(id SecretId) ([]ChangeEvent, error) { | ||
return []ChangeEvent{}, nil | ||
} | ||
|
||
func (s *NullStore) Delete(id SecretId) error { | ||
return errors.New("Not implemented for Null Store") | ||
} |