ipfs-cluster/state/empty.go
Hector Sanjuan 508791b547 Migrate from ipfs/ipfs-cluster to ipfs-cluster/ipfs-cluster
This performs the necessary renamings.
2022-06-16 17:43:30 +02:00

28 lines
482 B
Go

package state
import (
"context"
"github.com/ipfs-cluster/ipfs-cluster/api"
)
type empty struct{}
func (e *empty) List(ctx context.Context, out chan<- api.Pin) error {
close(out)
return nil
}
func (e *empty) Has(ctx context.Context, c api.Cid) (bool, error) {
return false, nil
}
func (e *empty) Get(ctx context.Context, c api.Cid) (api.Pin, error) {
return api.Pin{}, ErrNotFound
}
// Empty returns an empty read-only state.
func Empty() ReadOnly {
return &empty{}
}