func New(ds *DataSource) error {
	if ds.URL == "" {
		return errors.New("datasource: url required")
	}
	if ds.Method == "" {
		return errors.New("datasource: method required")
	}
	conn, err := db.Conn()
	if err != nil {
		logger().Error(err)
		return err
	}
	defer conn.Close()
	return conn.DataSources().Insert(&ds)
}
New creates a new data source instance.
package datasource
import (
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"github.com/tsuru/tsuru-autoscale/db"
	"github.com/tsuru/tsuru-autoscale/log"
	mgo "gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"
)
func logger() *log.Logger {
	return log.Log()
}
type DataSource struct {
	Name               string
	URL                string
	Method             string
	Body               string
	Headers            map[string]string
	Public             bool
	ExpressionTemplate string
}