Clears and frees secrets determined by func.
func
the Connection
function to be called to determine whether a specific secret should be cleared or not
caller-supplied data passed to func