voting_periods

package
v0.0.0-...-80b2b3e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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 (r *Repository) PeriodNonVotersList(id int64, limit uint, offset uint) (periodProposals []models.Voter, err error)

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 (r *Repository) ProtocolsList(limit uint, offset uint) (protocolsList []models.Protocol, err error)

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)

Jump to

Keyboard shortcuts

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