Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PubsubEvent = "replica"
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager keeps the replica up to date and in sync with other replicas.
func New ¶
func New(ctx context.Context, logger slog.Logger, db database.Store, ps pubsub.Pubsub, options *Options) (*Manager, error)
New registers the replica with the database and periodically updates to ensure it's healthy. It contacts all other alive replicas to ensure they are reachable.
func (*Manager) SetCallback ¶
func (m *Manager) SetCallback(callback func())
SetCallback sets a function to execute whenever new peers are refreshed or updated.
Click to show internal directories.
Click to hide internal directories.