userdata

package
v0.0.0-...-a29ada9 Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: ISC, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

Types

type DBConfig

type DBConfig struct {
	DBHost     string
	DBName     string
	DBPassword string
	DBPort     string
	DBUser     string
}

type UserData

type UserData struct {
	sync.RWMutex
	DBConfig         *DBConfig
	UserVotingConfig map[string]UserVotingConfig // [multisigaddr]
}

UserData stores the current snapshot of the user voting config.

func (*UserData) DBSetConfig

func (u *UserData) DBSetConfig(DBUser string, DBPassword string, DBHost string, DBPort string, DBName string)

DBSetConfig sets the database configuration.

func (*UserData) MySQLFetchAddedLowFeeTickets

func (u *UserData) MySQLFetchAddedLowFeeTickets() (map[chainhash.Hash]string, error)

MySQLFetchAddedLowFeeTickets fetches any low fee tickets that were manually added by the admin.

func (*UserData) MySQLFetchUserVotingConfig

func (u *UserData) MySQLFetchUserVotingConfig() (map[string]UserVotingConfig, error)

MySQLFetchUserVotingConfig fetches the voting preferences of all users who have completed registration of the pool by submitting an address and generating a multisig ticket address.

type UserVotingConfig

type UserVotingConfig struct {
	Userid          int64
	MultiSigAddress string
	VoteBits        uint16
	VoteBitsVersion uint32
}

UserVotingConfig contains per-user voting preferences.

Jump to

Keyboard shortcuts

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