mysqlpersister

package
v0.0.0-...-e20e094 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateConfig = errors.New("config with provided version number already exists")

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Connect() (*sql.DB, error)
}

type MysqlPersister

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

func New

func New(c Connector, pollingInterval time.Duration) (*MysqlPersister, error)

func (*MysqlPersister) Close

func (mp *MysqlPersister) Close()

Close closes the notification channel and the connection to MySQL.

func (*MysqlPersister) ConfigChangedWatcher

func (mp *MysqlPersister) ConfigChangedWatcher() <-chan struct{}

ConfigChangedWatcher returns a channel that is notified whenever a new config is available.

func (*MysqlPersister) PersistAndNotify

func (mp *MysqlPersister) PersistAndNotify(_ string, c *qsc.ServiceConfig) error

PersistAndNotify persists a marshalled configuration passed in.

func (*MysqlPersister) ReadHistoricalConfigs

func (mp *MysqlPersister) ReadHistoricalConfigs() ([]*qsc.ServiceConfig, error)

ReadHistoricalConfigs returns an array of previously persisted configs

func (*MysqlPersister) ReadPersistedConfig

func (mp *MysqlPersister) ReadPersistedConfig() (*qsc.ServiceConfig, error)

ReadPersistedConfig provides a config previously persisted.

type UnsafeConnector

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

func NewUnsafeConnector

func NewUnsafeConnector(dbUser, dbPass, dbHost string, dbPort int, dbName string) *UnsafeConnector

func (*UnsafeConnector) Connect

func (c *UnsafeConnector) Connect() (*sql.DB, error)

Jump to

Keyboard shortcuts

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