1
0
mirror of https://github.com/alexedwards/scs.git synced 2025-07-13 01:00:17 +02:00

Fix typos in documentation

This commit is contained in:
gandaldf
2022-02-09 11:27:58 +01:00
parent b95d685652
commit 6c6ff2c7bb
8 changed files with 15 additions and 12 deletions

View File

@ -103,6 +103,10 @@ However, there may be occasions when your use of a session store instance is tra
```go
func TestExample(t *testing.T) {
sqldb, err := sql.Open("pg", "postgres://username:password@host/dbname")
if err != nil {
log.Fatal(err)
}
db := bun.NewDB(sqldb, pgdialect.New())
defer db.Close()

View File

@ -86,7 +86,7 @@ However, there may be occasions when your use of a session store instance is tra
```go
func TestExample(t *testing.T) {
db, err := sql.Open("postgres", "postgres://user:pass@localhost/db")
db, err := sql.Open("postgres", "postgres://username:password@host/dbname")
if err != nil {
t.Fatal(err)
}

View File

@ -30,8 +30,7 @@ func main() {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
client, err := mongo.Connect(ctx, options.Client().ApplyURI("mongodb://localhost:27017"))
client, err := mongo.Connect(ctx, options.Client().ApplyURI("mongodb://host:27017"))
defer func() {
if err = client.Disconnect(ctx); err != nil {
panic(err)
@ -81,8 +80,8 @@ However, there may be occasions when your use of a session store instance is tra
func TestExample(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
client, err := mongo.Connect(ctx, options.Client().ApplyURI("mongodb://localhost:27017"))
client, err := mongo.Connect(ctx, options.Client().ApplyURI("mongodb://host:27017"))
defer func() {
if err = client.Disconnect(ctx); err != nil {
panic(err)

View File

@ -86,7 +86,7 @@ However, there may be occasions when your use of a session store instance is tra
```go
func TestExample(t *testing.T) {
db, err := sql.Open("mysql", "user:pass@/db?parseTime=true")
db, err := sql.Open("mysql", "username:password@tcp(host)/dbname?parseTime=true")
if err != nil {
t.Fatal(err)
}

View File

@ -85,7 +85,7 @@ However, there may be occasions when your use of a session store instance is tra
```go
func TestExample(t *testing.T) {
pool, err := pgxpool.Connect(context.Background(), "postgres://user:pass@localhost/db")
pool, err := pgxpool.Connect(context.Background(), "postgres://username:password@host/dbname")
if err != nil {
t.Fatal(err)
}

View File

@ -86,7 +86,7 @@ However, there may be occasions when your use of a session store instance is tra
```go
func TestExample(t *testing.T) {
db, err := sql.Open("postgres", "postgres://user:pass@localhost/db")
db, err := sql.Open("postgres", "postgres://username:password@host/dbname")
if err != nil {
t.Fatal(err)
}

View File

@ -27,7 +27,7 @@ func main() {
pool := &redis.Pool{
MaxIdle: 10,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", "localhost:6379")
return redis.Dial("tcp", "host:6379")
},
}
@ -70,7 +70,7 @@ Because the token is highly unique, key collisions are not a concern. But if you
pool := &redis.Pool{
MaxIdle: 10,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", "localhost:6379")
return redis.Dial("tcp", "host:6379")
},
}

View File

@ -70,10 +70,10 @@ This package provides a background 'cleanup' goroutine to delete expired session
```go
// Run a cleanup every 30 minutes.
SQLite3Store.NewWithCleanupInterval(db, 30*time.Minute)
sqlite3store.NewWithCleanupInterval(db, 30*time.Minute)
// Disable the cleanup goroutine by setting the cleanup interval to zero.
SQLite3Store.NewWithCleanupInterval(db, 0)
sqlite3store.NewWithCleanupInterval(db, 0)
```
### Terminating the Cleanup Goroutine
@ -90,7 +90,7 @@ func TestExample(t *testing.T) {
}
defer db.Close()
store := SQLite3Store.New(db)
store := sqlite3store.New(db)
defer store.StopCleanup()
sessionManager = scs.New()