Documentation ¶
Index ¶
- type PreparedVote
- type PreparedVoteRepo
- type Proposal
- type ProposalRepo
- func (r *ProposalRepo) DeleteByID(id ...string) error
- func (r *ProposalRepo) GetByID(id string) (*Proposal, error)
- func (r *ProposalRepo) GetLatestProposal() (*Proposal, error)
- func (r *ProposalRepo) GetProposalForVotes(limit int) ([]string, error)
- func (r *ProposalRepo) GetProposalIDsForUpdate(interval time.Duration, limit int, randOrder bool) ([]string, error)
- func (r *ProposalRepo) MarkVotesProcessed(id string) error
- func (r *ProposalRepo) Upsert(p *Proposal) (isNew bool, err error)
- type ProposalService
- func (s *ProposalService) Delete(ids []string) error
- func (s *ProposalService) GetLatestProposal() (*Proposal, error)
- func (s *ProposalService) GetProposalForVotes(limit int) ([]string, error)
- func (s *ProposalService) GetProposalIDsForUpdate(interval time.Duration, limit int, randOrder bool) ([]string, error)
- func (s *ProposalService) MarkVotesProcessed(id string) error
- func (s *ProposalService) Upsert(p *Proposal) error
- type Publisher
- type Space
- type SpaceRepo
- type SpaceService
- type Vote
- type VoteRepo
- type VoteService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PreparedVote ¶
type PreparedVoteRepo ¶
type PreparedVoteRepo struct {
// contains filtered or unexported fields
}
func NewPreparedVoteRepo ¶
func NewPreparedVoteRepo(conn *gorm.DB) *PreparedVoteRepo
func (*PreparedVoteRepo) Create ¶
func (r *PreparedVoteRepo) Create(pv *PreparedVote) error
func (*PreparedVoteRepo) Get ¶
func (r *PreparedVoteRepo) Get(id uuid.UUID) (PreparedVote, error)
type ProposalRepo ¶
type ProposalRepo struct {
// contains filtered or unexported fields
}
func NewProposalRepo ¶
func NewProposalRepo(conn *gorm.DB) *ProposalRepo
func (*ProposalRepo) DeleteByID ¶
func (r *ProposalRepo) DeleteByID(id ...string) error
func (*ProposalRepo) GetLatestProposal ¶
func (r *ProposalRepo) GetLatestProposal() (*Proposal, error)
func (*ProposalRepo) GetProposalForVotes ¶
func (r *ProposalRepo) GetProposalForVotes(limit int) ([]string, error)
func (*ProposalRepo) GetProposalIDsForUpdate ¶
func (*ProposalRepo) MarkVotesProcessed ¶
func (r *ProposalRepo) MarkVotesProcessed(id string) error
type ProposalService ¶
type ProposalService struct {
// contains filtered or unexported fields
}
func NewProposalService ¶
func NewProposalService(repo *ProposalRepo, publisher Publisher) *ProposalService
func (*ProposalService) Delete ¶
func (s *ProposalService) Delete(ids []string) error
func (*ProposalService) GetLatestProposal ¶
func (s *ProposalService) GetLatestProposal() (*Proposal, error)
func (*ProposalService) GetProposalForVotes ¶
func (s *ProposalService) GetProposalForVotes(limit int) ([]string, error)
func (*ProposalService) GetProposalIDsForUpdate ¶
func (*ProposalService) MarkVotesProcessed ¶
func (s *ProposalService) MarkVotesProcessed(id string) error
func (*ProposalService) Upsert ¶
func (s *ProposalService) Upsert(p *Proposal) error
type SpaceRepo ¶
type SpaceRepo struct {
// contains filtered or unexported fields
}
func NewSpaceRepo ¶
func (*SpaceRepo) FindUndefinedSpaceIDs ¶
type SpaceService ¶
type SpaceService struct {
// contains filtered or unexported fields
}
func NewSpaceService ¶
func NewSpaceService(repo *SpaceRepo, publisher Publisher) *SpaceService
func (*SpaceService) GetUndefinedSpaceIDs ¶
func (s *SpaceService) GetUndefinedSpaceIDs(limit int) ([]string, error)
func (*SpaceService) Upsert ¶
func (s *SpaceService) Upsert(space *Space) error
type Vote ¶
type Vote struct { ID string `gorm:"primarykey"` Ipfs string CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Voter string SpaceID string ProposalID string Choice json.RawMessage `gorm:"serializer:json"` Reason string App string Vp float64 VpByStrategy []float64 `gorm:"serializer:json"` VpState string Published bool }
type VoteRepo ¶
type VoteRepo struct {
// contains filtered or unexported fields
}
func NewVoteRepo ¶
func (*VoteRepo) BatchCreate ¶
BatchCreate creates votes in batch
func (*VoteRepo) MarkAsPublished ¶
type VoteService ¶
type VoteService struct {
// contains filtered or unexported fields
}
func NewVoteService ¶
func NewVoteService(repo *VoteRepo, publisher Publisher) *VoteService
func (*VoteService) BatchCreate ¶
func (s *VoteService) BatchCreate(votes []Vote) error
func (*VoteService) GetLatestVote ¶
func (s *VoteService) GetLatestVote(id string) (*Vote, error)
func (*VoteService) Upsert ¶
func (s *VoteService) Upsert(vote *Vote) error
Click to show internal directories.
Click to hide internal directories.