db

package
v0.0.0-...-8bdf0cb Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(c *config.Config) (*Backend, error)

func (*Backend) AddRepository

func (backend *Backend) AddRepository(r *core.Repository) (added bool, err error)

func (*Backend) AttemptLeadership

func (backend *Backend) AttemptLeadership() error

func (*Backend) ContinuousElections

func (backend *Backend) ContinuousElections(logError func(error))

ContinuousElections is a utility function to routinely observe leadership state. It doesn't actually do much; merely takes notes.

func (*Backend) DeleteRepository

func (backend *Backend) DeleteRepository(r *core.Repository) (deleted bool, err error)

func (*Backend) ExpireStaleMigrations

func (backend *Backend) ExpireStaleMigrations(inStatus, toStatus core.MigrationStatus, staleMinutes int) error

func (*Backend) ForceLeadership

func (backend *Backend) ForceLeadership() error

func (*Backend) ForgetPR

func (backend *Backend) ForgetPR(pr *core.PullRequest) (err error)

func (*Backend) ForgetPRStatementsAndMigrations

func (backend *Backend) ForgetPRStatementsAndMigrations(pr *core.PullRequest) (err error)

func (*Backend) GetLeader

func (backend *Backend) GetLeader() string

func (*Backend) GetStateDescription

func (backend *Backend) GetStateDescription() string

func (*Backend) IsHealthy

func (backend *Backend) IsHealthy() bool

func (*Backend) IsLeader

func (backend *Backend) IsLeader() bool

func (*Backend) OwnMigration

func (backend *Backend) OwnMigration(migration *core.Migration, token string) (ownedMigration *core.Migration, err error)

func (*Backend) OwnReadyMigration

func (backend *Backend) OwnReadyMigration(withStrategy core.MigrationStrategy, token string) (migration *core.Migration, err error)

func (*Backend) QueuePRMigrations

func (backend *Backend) QueuePRMigrations(pr *core.PullRequest) (countAffected int64, err error)

func (*Backend) ReadActivePRs

func (backend *Backend) ReadActivePRs() (prs []core.PullRequest, err error)

func (*Backend) ReadGhostReadyMigrations

func (backend *Backend) ReadGhostReadyMigrations(tokenHint string) (migrations []core.Migration, err error)

func (*Backend) ReadLeadership

func (backend *Backend) ReadLeadership() (leaderState int64, leader string, err error)

func (*Backend) ReadMigration

func (backend *Backend) ReadMigration(pr *core.PullRequest, tableName string) (migration *core.Migration, err error)

func (*Backend) ReadMigrationByToken

func (backend *Backend) ReadMigrationByToken(token string) (migration *core.Migration, err error)

func (*Backend) ReadNonCancelledMigrations

func (backend *Backend) ReadNonCancelledMigrations(pr *core.PullRequest) (migrations []core.Migration, err error)

func (*Backend) ReadNonCompletedPRsWithCompletedMigrations

func (backend *Backend) ReadNonCompletedPRsWithCompletedMigrations() (prs []core.PullRequest, err error)

func (*Backend) ReadOpenPRs

func (backend *Backend) ReadOpenPRs() (prs []core.PullRequest, err error)

func (*Backend) ReadPR

func (backend *Backend) ReadPR(pr *core.PullRequest) (err error)

func (*Backend) ReadPullRequestMigrationStatements

func (backend *Backend) ReadPullRequestMigrationStatements(pr *core.PullRequest) (statements []core.PullRequestMigrationStatement, err error)

func (*Backend) ReadRepositories

func (backend *Backend) ReadRepositories() (repos []core.Repository, err error)

func (*Backend) ReadRepository

func (backend *Backend) ReadRepository(r *core.Repository) (err error)

func (*Backend) ReadRepositoryMappings

func (backend *Backend) ReadRepositoryMappings(r *core.Repository) (mappings []core.RepositoryProductionMapping, err error)

func (*Backend) Reelect

func (backend *Backend) Reelect() error

func (*Backend) RemoveRepositoryMapping

func (backend *Backend) RemoveRepositoryMapping(m *core.RepositoryProductionMapping) (err error)

func (*Backend) ServiceId

func (backend *Backend) ServiceId() string

func (*Backend) SubmitMigrations

func (backend *Backend) SubmitMigrations(migrations []*core.Migration) (countSubmitted int64, err error)

func (*Backend) SubmitPR

func (backend *Backend) SubmitPR(pr *core.PullRequest) (err error)

func (*Backend) SubmitPRStatements

func (backend *Backend) SubmitPRStatements(pr *core.PullRequest, statements []string) (err error)

func (*Backend) UpdateMigrationStatus

func (backend *Backend) UpdateMigrationStatus(migration *core.Migration, fromStatus, toStatus core.MigrationStatus, withStrategy core.MigrationStrategy) (countAffected int64, err error)

func (*Backend) UpdateMigrationStrategy

func (backend *Backend) UpdateMigrationStrategy(migration *core.Migration, fromStrategy, toStrategy core.MigrationStrategy) (countAffected int64, err error)

func (*Backend) UpdateMigrationTokenHint

func (backend *Backend) UpdateMigrationTokenHint(migration *core.Migration, tokenHint string) (err error)

func (*Backend) UpdatePRMigrationsStatus

func (backend *Backend) UpdatePRMigrationsStatus(pr *core.PullRequest, fromStatus, toStatus core.MigrationStatus, withStrategy core.MigrationStrategy) (countAffected int64, err error)

func (*Backend) UpdatePRPriority

func (backend *Backend) UpdatePRPriority(pr *core.PullRequest, priority core.PullRequestPriority) (countAffected int64, err error)

func (*Backend) UpdatePRStatus

func (backend *Backend) UpdatePRStatus(pr *core.PullRequest, toStatus core.PullRequestStatus) (countAffected int64, err error)

func (*Backend) UpdateRepository

func (backend *Backend) UpdateRepository(r *core.Repository) (updated bool, err error)

func (*Backend) WriteRepositoryMapping

func (backend *Backend) WriteRepositoryMapping(m *core.RepositoryProductionMapping) (err error)

type TopologyDB

type TopologyDB struct {
	// contains filtered or unexported fields
}

func NewTopologyDB

func NewTopologyDB(c *config.Config, migration *core.Migration) (*TopologyDB, error)

func (*TopologyDB) Exec

func (topology *TopologyDB) Exec(query string) (rowsAffected int64, err error)

func (*TopologyDB) Get

func (topology *TopologyDB) Get(dest interface{}, query string, args ...interface{}) (err error)

func (*TopologyDB) Ping

func (topology *TopologyDB) Ping() (readOnly bool, err error)

Jump to

Keyboard shortcuts

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