Documentation ¶
Index ¶
- type Repo
- type Repository
- func (r *Repository) BallotsList(id int64) (periodBallots []models.PeriodBallot, err error)
- func (r *Repository) GetCurrentPeriodId() (id int64, err error)
- func (r *Repository) Info(id int64) (periodInfo models.PeriodStats, err error)
- func (r *Repository) List() (periods []models.PeriodInfo, err error)
- func (r *Repository) PeriodNonVotersCount(id int64) (count int64, err error)
- func (r *Repository) PeriodNonVotersList(id int64, limit uint, offset uint) (periodProposals []models.Voter, err error)
- func (r *Repository) ProposalInfo(proposal string) (proposalInfo models.ProposalInfo, err error)
- func (r *Repository) ProposalsCount() (count int64, err error)
- func (r *Repository) ProposalsList(id *int64, limit uint) (periodProposals []models.VotingProposal, err error)
- func (r *Repository) ProtocolsList(limit uint, offset uint) (protocolsList []models.Protocol, err error)
- func (r *Repository) StatsByKind(periodKind string) (periods []models.PeriodStats, err error)
- func (r *Repository) VotersCount(id int64, kind string) (count int64, err error)
- func (r *Repository) VotersList(id int64, kind string, limit uint, offset uint) (periodProposals []models.ProposalVoter, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { List() ([]models.PeriodInfo, error) Info(id int64) (models.PeriodStats, error) GetCurrentPeriodId() (int64, error) BallotsList(id int64) ([]models.PeriodBallot, error) ProposalInfo(proposal string) (models.ProposalInfo, error) ProposalsList(id *int64, limit uint) ([]models.VotingProposal, error) StatsByKind(periodType string) ([]models.PeriodStats, error) VotersList(id int64, kind string, limit uint, offset uint) (periodProposals []models.ProposalVoter, err error) VotersCount(id int64, kind string) (count int64, err error) PeriodNonVotersList(id int64, limit uint, offset uint) (periodProposals []models.Voter, err error) PeriodNonVotersCount(id int64) (count int64, err error) ProtocolsList(limit uint, offset uint) ([]models.Protocol, error) ProposalsCount() (count int64, err error) }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the snapshots repo implementation.
func New ¶
func New(db *gorm.DB) *Repository
New creates an instance of repository using the provided db.
func (*Repository) BallotsList ¶
func (r *Repository) BallotsList(id int64) (periodBallots []models.PeriodBallot, err error)
func (*Repository) GetCurrentPeriodId ¶
func (r *Repository) GetCurrentPeriodId() (id int64, err error)
func (*Repository) Info ¶
func (r *Repository) Info(id int64) (periodInfo models.PeriodStats, err error)
func (*Repository) List ¶
func (r *Repository) List() (periods []models.PeriodInfo, err error)
func (*Repository) PeriodNonVotersCount ¶
func (r *Repository) PeriodNonVotersCount(id int64) (count int64, err error)
func (*Repository) PeriodNonVotersList ¶
func (*Repository) ProposalInfo ¶
func (r *Repository) ProposalInfo(proposal string) (proposalInfo models.ProposalInfo, err error)
func (*Repository) ProposalsCount ¶
func (r *Repository) ProposalsCount() (count int64, err error)
func (*Repository) ProposalsList ¶
func (r *Repository) ProposalsList(id *int64, limit uint) (periodProposals []models.VotingProposal, err error)
func (*Repository) ProtocolsList ¶
func (*Repository) StatsByKind ¶
func (r *Repository) StatsByKind(periodKind string) (periods []models.PeriodStats, err error)
func (*Repository) VotersCount ¶
func (r *Repository) VotersCount(id int64, kind string) (count int64, err error)
func (*Repository) VotersList ¶
func (r *Repository) VotersList(id int64, kind string, limit uint, offset uint) (periodProposals []models.ProposalVoter, err error)
Click to show internal directories.
Click to hide internal directories.