...

Package mysql

import "github.com/hyperledger/fabric-ca/lib/server/db/mysql"
Overview
Index
Subdirectories

Overview ▾

type Migrator

Migrator defines migrator

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

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 Mysql

Mysql defines MySQL database

type Mysql struct {
    SqlxDB          db.FabricCADB
    TLS             *tls.ClientTLSConfig
    CSP             bccsp.BCCSP
    CAName          string
    MetricsProvider metrics.Provider
    // contains filtered or unexported fields
}

func NewDB

func NewDB(datasource, caName string, clientTLSConfig *tls.ClientTLSConfig, csp bccsp.BCCSP, metricsProvider metrics.Provider) *Mysql

NewDB create a MySQL database

func (*Mysql) Connect

func (m *Mysql) Connect() error

Connect connects to a MySQL server

func (*Mysql) Create

func (m *Mysql) Create() (*db.DB, error)

Create creates database and tables

func (*Mysql) CreateDatabase

func (m *Mysql) CreateDatabase() (*db.DB, error)

CreateDatabase creates database

func (*Mysql) CreateTables

func (m *Mysql) CreateTables() error

CreateTables creates table

func (*Mysql) PingContext

func (m *Mysql) PingContext(ctx context.Context) error

PingContext pings the database

Subdirectories

Name Synopsis
..
mocks Code generated by counterfeiter.