Esempio n. 1
0
File: url.go Progetto: shingara/goup
func AllUrl() []Url {
	c := config.Config_collection(url_collection_name)
	defer c.Close()

	result := []Url{}
	c.Collection.Find(nil).All(&result)
	return result
}
Esempio n. 2
0
// Insert this url with url pass in args
// TODO: Need valid Url
func AddCheck(check *Check) {
	c := config.Config_collection(check_collection_name)
	defer c.Close()

	err := c.Collection.Insert(check)
	if err != nil {
		panic(err)
	}
}
Esempio n. 3
0
File: url.go Progetto: shingara/goup
// Insert this url with url pass in args
// TODO: Need valid Url
func AddUrl(url *Url) {
	c := config.Config_collection(url_collection_name)
	defer c.Close()

	err := c.Collection.Insert(url)
	if err != nil {
		panic(err)
	}
}
Esempio n. 4
0
File: url.go Progetto: shingara/goup
// Get the url with this url pass in args
func GetUrl(url string) *Url {
	c := config.Config_collection(url_collection_name)
	defer c.Close()

	result := &Url{}
	err := c.Collection.Find(bson.M{"url": url}).One(&result)
	if err != nil {
		panic(err)
	}
	return result
}