func (db *DB) DeleteResource(id manifold.ID) bool {
	_, ok := db.ResourcesByID[id]
	if ok {
		cs := db.CredentialsByResource[id]
		for _, c := range cs {
			db.DeleteCredential(c.ID)
		}
		delete(db.ResourcesByID, id)
		return true
	}
	return false
}
DeleteResource removes a resource and returns true, false if there was no resource
package db
import (
	"time"
	manifold "github.com/manifoldco/go-manifold"
)
type DB struct {
	ResourcesByID         map[manifold.ID]Resource
	CredentialsByResource map[manifold.ID][]Credential
	CredentialsByID       map[manifold.ID]Credential
	MeasuresByResource    map[manifold.ID][]Measure
}
func New() *DB {
	return &DB{
		ResourcesByID:         make(map[manifold.ID]Resource),
		CredentialsByResource: make(map[manifold.ID][]Credential),
		CredentialsByID:       make(map[manifold.ID]Credential),
		MeasuresByResource:    make(map[manifold.ID][]Measure),
	}
}
func (db *DB) PutResource(r Resource) {
	db.ResourcesByID[r.ID] = r
}
func (db *DB) GetResource(id manifold.ID) *Resource {
	r, ok := db.ResourcesByID[id]
	if ok {
		return &r
	}
	return nil
}