func (p *AddressProvider) ServerAddr(id raft.ServerID) (raft.ServerAddress, error) {
	databaseID, err := strconv.Atoi(string(id))
	if err != nil {
		return "", errors.Wrap(err, "non-numeric server ID")
	}
	var address string
	if err := p.db.Transaction(func(tx *db.NodeTx) error {
		var err error
		address, err = tx.RaftNodeAddress(int64(databaseID))
		return errors.WithStack(err)
	}); err != nil {
		return "", errors.WithStack(err)
	}
	return raft.ServerAddress(address), nil
}
ServerAddr gets the raft ServerAddress from the raft nodes, depending on
the id supplied
package raft
import (
	"context"
	"strconv"
	"sync"
	"time"
	"github.com/hashicorp/raft"
	"github.com/pkg/errors"
	"github.com/spoke-d/thermionic/internal/db"
	"github.com/spoke-d/thermionic/internal/lru"
	"github.com/spoke-d/task"
)
const Interval = 4
type AddressProvider struct {
	db Node
}
func NewAddressProvider(db Node) *AddressProvider {
	return &AddressProvider{
		db: db,
	}
}