fix store context issues
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -52,14 +52,14 @@ func (s *storage) Store(key string, value []byte) error {
|
||||
Key: key,
|
||||
Value: buf.Bytes(),
|
||||
}
|
||||
return s.store.Write(r)
|
||||
return s.store.Write(s.store.Options().Context, r)
|
||||
}
|
||||
|
||||
func (s *storage) Load(key string) ([]byte, error) {
|
||||
if !s.Exists(key) {
|
||||
return nil, certmagic.ErrNotExist(errors.New(key + " doesn't exist"))
|
||||
}
|
||||
records, err := s.store.Read(key)
|
||||
records, err := s.store.Read(s.store.Options().Context, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -77,18 +77,18 @@ func (s *storage) Load(key string) ([]byte, error) {
|
||||
}
|
||||
|
||||
func (s *storage) Delete(key string) error {
|
||||
return s.store.Delete(key)
|
||||
return s.store.Delete(s.store.Options().Context, key)
|
||||
}
|
||||
|
||||
func (s *storage) Exists(key string) bool {
|
||||
if _, err := s.store.Read(key); err != nil {
|
||||
if _, err := s.store.Read(s.store.Options().Context, key); err != nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (s *storage) List(prefix string, recursive bool) ([]string, error) {
|
||||
keys, err := s.store.List()
|
||||
keys, err := s.store.List(s.store.Options().Context)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func (s *storage) List(prefix string, recursive bool) ([]string, error) {
|
||||
}
|
||||
|
||||
func (s *storage) Stat(key string) (certmagic.KeyInfo, error) {
|
||||
records, err := s.store.Read(key)
|
||||
records, err := s.store.Read(s.store.Options().Context, key)
|
||||
if err != nil {
|
||||
return certmagic.KeyInfo{}, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user