Improved docs for #10

This commit is contained in:
Carlos Alexandro Becker 2015-09-17 19:49:25 -03:00
parent 31a178b4b1
commit c10f375a5e
1 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,8 @@ type Session struct {
ExpiresOn time.Time `db:"expires_on"`
}
// NewPGStore creates a new PGStore instance and a new database/sql pool
// NewPGStore creates a new PGStore instance and a new database/sql pool.
// This will also create in the database the schema needed by pgstore.
func NewPGStore(dbURL string, keyPairs ...[]byte) *PGStore {
db, err := sql.Open("postgres", dbURL)
if err != nil {
@ -42,7 +43,8 @@ func NewPGStore(dbURL string, keyPairs ...[]byte) *PGStore {
}
// NewPGStoreFromPool creates a new PGStore instance from an existing
// database/sql pool
// database/sql pool.
// This will also create in the database the schema needed by pgstore.
func NewPGStoreFromPool(db *sql.DB, keyPairs ...[]byte) *PGStore {
dbmap := &gorp.DbMap{Db: db, Dialect: gorp.PostgresDialect{}}