2020-10-26 18:12:01 +01:00
|
|
|
package store
|
|
|
|
|
2021-01-09 05:08:20 +01:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/lbryio/lbry.go/v2/stream"
|
|
|
|
"github.com/lbryio/reflector.go/shared"
|
|
|
|
)
|
2020-10-26 18:12:01 +01:00
|
|
|
|
|
|
|
// NoopStore is a store that does nothing
|
|
|
|
type NoopStore struct{}
|
|
|
|
|
|
|
|
const nameNoop = "noop"
|
|
|
|
|
2021-01-09 05:08:20 +01:00
|
|
|
func (n *NoopStore) Name() string { return nameNoop }
|
|
|
|
func (n *NoopStore) Has(_ string) (bool, error) { return false, nil }
|
|
|
|
func (n *NoopStore) Get(_ string) (stream.Blob, shared.BlobTrace, error) {
|
|
|
|
return nil, shared.NewBlobTrace(time.Since(time.Now()), n.Name()), nil
|
|
|
|
}
|
2020-10-26 18:12:01 +01:00
|
|
|
func (n *NoopStore) Put(_ string, _ stream.Blob) error { return nil }
|
|
|
|
func (n *NoopStore) PutSD(_ string, _ stream.Blob) error { return nil }
|
|
|
|
func (n *NoopStore) Delete(_ string) error { return nil }
|
2020-12-23 06:04:42 +01:00
|
|
|
func (n *NoopStore) Shutdown() { return }
|