Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSyncDisabled = errors.New("data sharing is disabled on this instance")
)
Functions ¶
func DecodeSyncObj ¶
func DecodeSyncObj(obj interface{}, receiver interface{}) error
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func RegisteredSources ¶
Types ¶
type Result ¶
type Store ¶
type Store interface { TableNames() []string LastEntry(ctx context.Context, tableName string, receiver interface{}) error LastExchangeEntryID() (id int64) SaveExchangeFromSync(ctx context.Context, exchange interface{}) error LastExchangeTickEntryTime() (time time.Time) SaveExchangeTickFromSync(ctx context.Context, tick interface{}) error StoreMempoolFromSync(ctx context.Context, mempoolDto interface{}) error SaveBlockFromSync(ctx context.Context, block interface{}) error SaveVoteFromSync(ctx context.Context, vote interface{}) error UpdatePropagationData(ctx context.Context) error AddPowDataFromSync(ctx context.Context, data interface{}) error AddVspSourceFromSync(ctx context.Context, vspDto interface{}) error AddVspTicksFromSync(ctx context.Context, tick VSPTickSyncDto) error }
type SyncCoordinator ¶
type SyncCoordinator struct {
// contains filtered or unexported fields
}
func NewCoordinator ¶
func NewCoordinator(isEnabled bool, period int) *SyncCoordinator
func (*SyncCoordinator) AddSource ¶
func (s *SyncCoordinator) AddSource(url string, store Store, database string)
func (*SyncCoordinator) AddSyncer ¶
func (s *SyncCoordinator) AddSyncer(tableName string, syncer Syncer)
func (*SyncCoordinator) StartSyncing ¶
func (s *SyncCoordinator) StartSyncing(ctx context.Context)
type VSPTickSyncDto ¶
type VSPTickSyncDto struct { ID int `json:"id"` VSPID int `json:"vspid"` VSP string `json:"vsp"` Immature int `json:"immature"` Live int `json:"live"` Voted int `json:"voted"` Missed int `json:"missed"` PoolFees float64 `json:"pool_fees"` ProportionLive float64 `json:"proportion_live"` ProportionMissed float64 `json:"proportion_missed"` UserCount int `json:"user_count"` UsersActive int `json:"users_active"` Time time.Time `json:"time"` }
Click to show internal directories.
Click to hide internal directories.