database

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigCache

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

func NewBigCache

func NewBigCache(c *config.BigCacheConfig) *BigCache

func (*BigCache) MappedIterator

func (c *BigCache) MappedIterator() *bigcache.EntryInfoIterator

func (*BigCache) RawIterator

func (c *BigCache) RawIterator() *bigcache.EntryInfoIterator

func (*BigCache) ReadMapped

func (c *BigCache) ReadMapped(where string, arguments ...interface{}) ([]message.Mapped, error)

func (*BigCache) ReadRaw

func (c *BigCache) ReadRaw(where string, arguments ...interface{}) ([]message.Raw, error)

func (*BigCache) WriteMapped

func (c *BigCache) WriteMapped(mappedList ...message.Mapped) []message.Mapped

func (*BigCache) WriteRaw

func (c *BigCache) WriteRaw(raw *message.Raw, returnChanges bool) []*message.Raw

type DatabaseCountReader added in v0.1.28

type DatabaseCountReader interface {
	ReadRawCount(where string, arguments ...interface{}) (int, error)
	ReadMappedCount(where string, arguments ...interface{}) (int, error)
}

type DatabaseReader

type DatabaseReader interface {
	ReadRaw(where string, arguments ...interface{}) ([]message.Raw, error)
	ReadMapped(where string, arguments ...interface{}) ([]message.Mapped, error)
}

type DatabaseWriter

type DatabaseWriter interface {
	WriteRaw(raw *message.Raw)
	WriteMapped(mapped *message.Mapped)
}

type PostgresqlDatabase

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

func NewPostgresqlDatabase

func NewPostgresqlDatabase(c *config.PostgresqlConfig) *PostgresqlDatabase

func (*PostgresqlDatabase) CreatePeriod added in v0.1.31

func (db *PostgresqlDatabase) CreatePeriod(origin string, start time.Time, end time.Time, remote int) error

Creates a period in the database, the default value for the local data points is -1

func (*PostgresqlDatabase) DowngradeDatabase

func (db *PostgresqlDatabase) DowngradeDatabase() error

func (*PostgresqlDatabase) GetConnection

func (db *PostgresqlDatabase) GetConnection() *pgxpool.Pool

func (*PostgresqlDatabase) LogTransferRequest added in v0.1.51

func (db *PostgresqlDatabase) LogTransferRequest(time time.Time, uuid uuid.UUID, origin string, start time.Time, end time.Time, local int, remote int) error

Log the transfer request

func (*PostgresqlDatabase) ReadMapped

func (db *PostgresqlDatabase) ReadMapped(appendToQuery string, arguments ...interface{}) ([]message.Mapped, error)

func (*PostgresqlDatabase) ReadMappedCount added in v0.1.28

func (db *PostgresqlDatabase) ReadMappedCount(start time.Time, end time.Time) (int, error)

func (*PostgresqlDatabase) SelectCompletePeriods added in v0.1.31

func (db *PostgresqlDatabase) SelectCompletePeriods(origin string) (map[int64]time.Time, error)

Returns the start timestamp of each period that has the same or more local rows than remote

func (*PostgresqlDatabase) SelectIncompletePeriods added in v0.1.31

func (db *PostgresqlDatabase) SelectIncompletePeriods(origin string) (map[int64]time.Time, error)

Returns the start timestamp of each period that has the same or more local rows than remote

func (*PostgresqlDatabase) SelectLocalAndRemoteDataPoints added in v0.1.31

func (db *PostgresqlDatabase) SelectLocalAndRemoteDataPoints(origin string, start time.Time, end time.Time) (int, int, error)

func (*PostgresqlDatabase) UpdateLocalDataPoints added in v0.1.31

func (db *PostgresqlDatabase) UpdateLocalDataPoints(origin string, start time.Time, end time.Time, dataPoints int) error

Update the local data points in the database

func (*PostgresqlDatabase) UpdateStatistics added in v0.1.51

func (db *PostgresqlDatabase) UpdateStatistics(time time.Time, origin string, start time.Time, end time.Time) error

func (*PostgresqlDatabase) UpgradeDatabase

func (db *PostgresqlDatabase) UpgradeDatabase() error

func (*PostgresqlDatabase) WriteMapped

func (db *PostgresqlDatabase) WriteMapped(mapped message.Mapped)

func (*PostgresqlDatabase) WriteRaw

func (db *PostgresqlDatabase) WriteRaw(raw message.Raw)

func (*PostgresqlDatabase) WriteSingleValueMapped added in v0.1.38

func (db *PostgresqlDatabase) WriteSingleValueMapped(svm message.SingleValueMapped)

Jump to

Keyboard shortcuts

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