GitHubはじめる

API リファレンスはソースコード内の Go ドキュメントコメントから生成されており、英語で記述されています。

package pgstore

import "github.com/nsgo-dev/game/pkg/online/cloudsave/pgstore"

概要

Package pgstore opens a cloudsave.Store in a Postgres database with the github.com/jackc/pgx/v5 driver. Several cloud save service processes may share one database: each write takes an advisory lock on the account, and migrations take one on the schema.

目次

関数

func Open(ctx context.Context, dsn string) (*sqlstore.Store, error)

Open connects to the Postgres database dsn names (a URL or a key=value string, as pgx parses it) and returns a store on it with the schema created. Several service processes may share the database. Keep the DSN, which may hold a password, out of logs and command lines: read it from the environment or a file. Close the store to close the connections.