mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
- database: added collection to var - website: changed gin.G to json type - api: status added cpu usage and move memory to stats - go: upgrade deps - update nodemon cfg and README
17 lines
295 B
Go
17 lines
295 B
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
)
|
|
|
|
func Delete(url *URL) (*mongo.DeleteResult, error) {
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
defer cancel()
|
|
|
|
result, err := Coll.DeleteOne(ctx, url)
|
|
|
|
return result, err
|
|
}
|