postgres

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator struct {
	Tx        db.FabricCATx
	CurLevels *util.Levels
	SrvLevels *util.Levels
}

Migrator defines migrator

func NewMigrator

func NewMigrator(tx db.FabricCATx, curLevels, srvLevels *util.Levels) *Migrator

NewMigrator returns a migrator instance

func (*Migrator) Commit

func (m *Migrator) Commit() error

Commit is responsible for committing the migration db transcation

func (*Migrator) MigrateAffiliationsTable

func (m *Migrator) MigrateAffiliationsTable() error

MigrateAffiliationsTable is responsible for migrating affiliations table

func (*Migrator) MigrateCertificatesTable

func (m *Migrator) MigrateCertificatesTable() error

MigrateCertificatesTable is responsible for migrating certificates table

func (*Migrator) MigrateCredentialsTable

func (m *Migrator) MigrateCredentialsTable() error

MigrateCredentialsTable is responsible for migrating credentials table

func (*Migrator) MigrateNoncesTable

func (m *Migrator) MigrateNoncesTable() error

MigrateNoncesTable is responsible for migrating nonces table

func (*Migrator) MigrateRAInfoTable

func (m *Migrator) MigrateRAInfoTable() error

MigrateRAInfoTable is responsible for migrating rainfo table

func (*Migrator) MigrateUsersTable

func (m *Migrator) MigrateUsersTable() error

MigrateUsersTable is responsible for migrating users table

func (*Migrator) Rollback

func (m *Migrator) Rollback() error

Rollback is responsible for rollback transaction if an error is encountered

type Postgres

type Postgres struct {
	SqlxDB  db.FabricCADB
	TLS     *tls.ClientTLSConfig
	CAName  string
	Metrics *db.Metrics
	// contains filtered or unexported fields
}

Postgres defines PostgreSQL database

func NewDB

func NewDB(
	datasource,
	caName string,
	clientTLSConfig *tls.ClientTLSConfig,
	metrics *db.Metrics,
) *Postgres

NewDB create a PosgreSQL database

func (*Postgres) Connect

func (p *Postgres) Connect() error

Connect connects to a PostgreSQL server

func (*Postgres) Create

func (p *Postgres) Create() (*db.DB, error)

Create creates database and tables

func (*Postgres) CreateDatabase

func (p *Postgres) CreateDatabase() (*db.DB, error)

CreateDatabase creates database

func (*Postgres) CreateTables

func (p *Postgres) CreateTables() error

CreateTables creates table

func (*Postgres) PingContext

func (p *Postgres) PingContext(ctx context.Context) error

PingContext pings the database

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL