Versions in this module Expand all Collapse all v0 v0.0.2 Sep 16, 2023 Changes in this version + const DefaultPostgresqlStorageSchema + const PostgresqlConnectionManagerName + const PostgresqlStorageName + var ErrQueryPostgresqlServerTime = errors.New("query postgresql server time failed") + type PostgresqlConnectionManager struct + DSN string + DatabaseName string + Host string + Passwd string + Port uint + User string + func NewPostgresqlConnectionGetterFromDsn(dsn string) *PostgresqlConnectionManager + func NewPostgresqlConnectionGetterFromSqlDb(db *sql.DB) *PostgresqlConnectionManager + func NewPostgresqlConnectionManager(host string, port uint, user, passwd, databaseName string) *PostgresqlConnectionManager + func (x *PostgresqlConnectionManager) GetDSN() string + func (x *PostgresqlConnectionManager) Name() string + func (x *PostgresqlConnectionManager) Return(ctx context.Context, connection *sql.DB) error + func (x *PostgresqlConnectionManager) Shutdown(ctx context.Context) error + func (x *PostgresqlConnectionManager) Take(ctx context.Context) (*sql.DB, error) + type PostgresqlSqlProvider struct + func NewPostgresqlSqlProvider() *PostgresqlSqlProvider + func (x *PostgresqlSqlProvider) CreateTableSql(ctx context.Context, tableFullName string) (string, []any) + func (x *PostgresqlSqlProvider) CreateWithVersionSql(ctx context.Context, tableFullName string, lockId string, ...) (string, []any) + func (x *PostgresqlSqlProvider) DeleteWithVersionSql(ctx context.Context, tableFullName string, lockId string, ...) (string, []any) + func (x *PostgresqlSqlProvider) FindLockInformationJsonStringByIdSql(ctx context.Context, tableFullName string, lockId string) (string, []any) + func (x *PostgresqlSqlProvider) ListLockInformationJsonStringSql(ctx context.Context, tableFullName string) (string, []any) + func (x *PostgresqlSqlProvider) NowTimestampSql(ctx context.Context, tableFullName string) (string, []any) + func (x *PostgresqlSqlProvider) SelectLockInformationJsonStringSql(ctx context.Context, tableFullName string, lockId string) (string, []any) + func (x *PostgresqlSqlProvider) UpdateWithVersionSql(ctx context.Context, tableFullName string, lockId string, ...) (string, []any) + type PostgresqlStorage struct + func NewPostgresqlStorage(ctx context.Context, options *PostgresqlStorageOptions) (*PostgresqlStorage, error) + func (x *PostgresqlStorage) CreateWithVersion(ctx context.Context, lockId string, version storage.Version, ...) (returnError error) + func (x *PostgresqlStorage) GetName() string + func (x *PostgresqlStorage) GetTime(ctx context.Context) (time.Time, error) + func (x *PostgresqlStorage) Init(ctx context.Context) (returnError error) + type PostgresqlStorageOptions struct + ConnectionManager storage.ConnectionManager[*sql.DB] + Schema string + TableName string + func NewPostgresqlStorageOptions() *PostgresqlStorageOptions + func (x *PostgresqlStorageOptions) Check() error + func (x *PostgresqlStorageOptions) GetSchema() string + func (x *PostgresqlStorageOptions) GetTableFullName() string + func (x *PostgresqlStorageOptions) GetTableName() string + func (x *PostgresqlStorageOptions) SetConnectionManager(connectionManager storage.ConnectionManager[*sql.DB]) *PostgresqlStorageOptions + func (x *PostgresqlStorageOptions) SetSchema(schema string) *PostgresqlStorageOptions + func (x *PostgresqlStorageOptions) SetTableName(tableName string) *PostgresqlStorageOptions v0.0.1 Aug 6, 2023 Changes in this version + const DefaultPostgreSQLStorageSchema + type PostgreSQLConnectionManager struct + DSN string + DatabaseName string + Host string + Passwd string + Port uint + User string + func NewPostgreSQLConnectionGetter(host string, port uint, user, passwd, databaseName string) *PostgreSQLConnectionManager + func NewPostgreSQLConnectionGetterFromDSN(dsn string) *PostgreSQLConnectionManager + func (x *PostgreSQLConnectionManager) GetDSN() string + func (x *PostgreSQLConnectionManager) Name() string + func (x *PostgreSQLConnectionManager) Return(ctx context.Context, connection *sql.DB) error + func (x *PostgreSQLConnectionManager) Shutdown(ctx context.Context) error + func (x *PostgreSQLConnectionManager) Take(ctx context.Context) (*sql.DB, error) + type PostgreSQLStorage struct + func NewPostgreSQLStorage(ctx context.Context, options *PostgreSQLStorageOptions) (*PostgreSQLStorage, error) + func (x *PostgreSQLStorage) Close(ctx context.Context) error + func (x *PostgreSQLStorage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, ...) error + func (x *PostgreSQLStorage) Get(ctx context.Context, lockId string) (string, error) + func (x *PostgreSQLStorage) GetName() string + func (x *PostgreSQLStorage) GetTime(ctx context.Context) (time.Time, error) + func (x *PostgreSQLStorage) Init(ctx context.Context) error + func (x *PostgreSQLStorage) InsertWithVersion(ctx context.Context, lockId string, version storage.Version, ...) error + func (x *PostgreSQLStorage) List(ctx context.Context) (iterator.Iterator[*storage.LockInformation], error) + func (x *PostgreSQLStorage) UpdateWithVersion(ctx context.Context, lockId string, ...) error + type PostgreSQLStorageOptions struct + ConnectionManager storage.ConnectionManager[*sql.DB] + Schema string + TableName string + func NewPostgreSQLStorageOptions() *PostgreSQLStorageOptions + func (x *PostgreSQLStorageOptions) SetConnectionManager(connectionManager storage.ConnectionManager[*sql.DB]) *PostgreSQLStorageOptions + func (x *PostgreSQLStorageOptions) SetSchema(schema string) *PostgreSQLStorageOptions + func (x *PostgreSQLStorageOptions) SetTableName(tableName string) *PostgreSQLStorageOptions