package merkledag import ( "context" cid "gitlab.dms3.io/dms3/go-cid" ld "gitlab.dms3.io/dms3/go-ld-format" ) // ErrorService implements ld.DAGService, returning 'Err' for every call. type ErrorService struct { Err error } var _ ld.DAGService = (*ErrorService)(nil) // Add returns the cs.Err. func (cs *ErrorService) Add(ctx context.Context, nd ld.Node) error { return cs.Err } // AddMany returns the cs.Err. func (cs *ErrorService) AddMany(ctx context.Context, nds []ld.Node) error { return cs.Err } // Get returns the cs.Err. func (cs *ErrorService) Get(ctx context.Context, c cid.Cid) (ld.Node, error) { return nil, cs.Err } // GetMany many returns the cs.Err. func (cs *ErrorService) GetMany(ctx context.Context, cids []cid.Cid) <-chan *ld.NodeOption { ch := make(chan *ld.NodeOption) close(ch) return ch } // Remove returns the cs.Err. func (cs *ErrorService) Remove(ctx context.Context, c cid.Cid) error { return cs.Err } // RemoveMany returns the cs.Err. func (cs *ErrorService) RemoveMany(ctx context.Context, cids []cid.Cid) error { return cs.Err }