http urls monitor.

db.go 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright (c) 2012-present The upper.io/db authors. All rights reserved.
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining
  4. // a copy of this software and associated documentation files (the
  5. // "Software"), to deal in the Software without restriction, including
  6. // without limitation the rights to use, copy, modify, merge, publish,
  7. // distribute, sublicense, and/or sell copies of the Software, and to
  8. // permit persons to whom the Software is furnished to do so, subject to
  9. // the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be
  12. // included in all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  18. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. // Package db (or upper-db) provides a common interface to work with different
  22. // data sources using adapters that wrap mature database drivers.
  23. //
  24. // The main purpose of upper-db is to abstract common database operations and
  25. // encourage users perform advanced operations directly using the underlying
  26. // driver. upper-db supports the MySQL, PostgreSQL, SQLite and QL databases and
  27. // provides partial support (CRUD, no transactions) for MongoDB.
  28. //
  29. // go get upper.io/db.v3
  30. //
  31. // Usage
  32. //
  33. // package main
  34. //
  35. // import (
  36. // "log"
  37. //
  38. // "upper.io/db.v3/postgresql" // Imports the postgresql adapter.
  39. // )
  40. //
  41. // var settings = postgresql.ConnectionURL{
  42. // Database: `booktown`,
  43. // Host: `demo.upper.io`,
  44. // User: `demouser`,
  45. // Password: `demop4ss`,
  46. // }
  47. //
  48. // // Book represents a book.
  49. // type Book struct {
  50. // ID uint `db:"id"`
  51. // Title string `db:"title"`
  52. // AuthorID uint `db:"author_id"`
  53. // SubjectID uint `db:"subject_id"`
  54. // }
  55. //
  56. // func main() {
  57. // sess, err := postgresql.Open(settings)
  58. // if err != nil {
  59. // log.Fatal(err)
  60. // }
  61. // defer sess.Close()
  62. //
  63. // var books []Book
  64. // if err := sess.Collection("books").Find().OrderBy("title").All(&books); err != nil {
  65. // log.Fatal(err)
  66. // }
  67. //
  68. // log.Println("Books:")
  69. // for _, book := range books {
  70. // log.Printf("%q (ID: %d)\n", book.Title, book.ID)
  71. // }
  72. // }
  73. //
  74. // See more usage examples and documentation for users at
  75. // https://upper.io/db.v3.
  76. package db // import "upper.io/db.v3"