Documentation ¶
Index ¶
- type Message
- type MessageRepo
- func (r *MessageRepo) CreateInBatches(messages []*Message) (newRows int, err error)
- func (r *MessageRepo) FindDaoUpdateSettings(limit, offset int) ([]string, error)
- func (r *MessageRepo) FindDeleteProposals(limit, offset int) ([]string, error)
- func (r *MessageRepo) FindLatestMCI() (int, error)
- func (r *MessageRepo) FindSpacesWithNewVotes(after time.Time) ([]string, error)
- func (r *MessageRepo) Upsert(m *Message) (isNew bool, err error)
- type MessageService
- func (s *MessageService) FindDaoUpdateSettings(limit, offset int) ([]string, error)
- func (s *MessageService) FindDeleteProposals(limit, offset int) ([]string, error)
- func (s *MessageService) FindSpacesWithNewVotes(after time.Time) ([]string, error)
- func (s *MessageService) GetLatestMCI() (int, error)
- func (s *MessageService) Upsert(message ...*Message) error
- type MessageType
- 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) GetFinishedShutterProposals(limit int) ([]string, error)
- func (r *ProposalRepo) GetLatestProposal() (*Proposal, error)
- func (r *ProposalRepo) GetProposalForVotes(limit int) ([]string, error)
- func (r *ProposalRepo) GetProposalIDsForUpdate(spaces []string, interval time.Duration, limit int, randOrder bool) ([]string, error)
- func (r *ProposalRepo) MarkProposalAsRefetched(id string) error
- func (r *ProposalRepo) MarkVotesProcessed(id string) error
- func (r *ProposalRepo) RemoveFetchedVotes(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) GetFinishedShutterProposals(limit int) ([]string, error)
- func (s *ProposalService) GetLatestProposal() (*Proposal, error)
- func (s *ProposalService) GetProposalForVotes(limit int) ([]string, error)
- func (s *ProposalService) GetProposalIDsForUpdate(spaces []string, interval time.Duration, limit int, randOrder bool) ([]string, error)
- func (s *ProposalService) MarkAsRefetched(id 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
- func (r *VoteRepo) BatchCreate(data []Vote) error
- func (r *VoteRepo) GetLatestVote() (*Vote, error)
- func (r *VoteRepo) GetLatestVoteByProposal(proposalID string) (*Vote, error)
- func (r *VoteRepo) MarkAsPublished(votes []Vote) error
- func (r *VoteRepo) SelectForPublish(limit int) ([]Vote, error)
- func (r *VoteRepo) Upsert(v *Vote) (isNew bool, err error)
- type VoteService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶ added in v0.5.1
type Message struct { ID string `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` MCI int `gorm:"unique_index"` Space string `gorm:"index:space_type_idx"` Timestamp time.Time `gorm:"index:space_type_idx"` Type MessageType `gorm:"index:space_type_idx"` Snapshot json.RawMessage `gorm:"type:jsonb;serializer:json"` IpfsID string `gorm:"-"` // virtual property }
type MessageRepo ¶ added in v0.5.1
type MessageRepo struct {
// contains filtered or unexported fields
}
func NewMessageRepo ¶ added in v0.5.1
func NewMessageRepo(conn *gorm.DB) *MessageRepo
func (*MessageRepo) CreateInBatches ¶ added in v0.5.1
func (r *MessageRepo) CreateInBatches(messages []*Message) (newRows int, err error)
func (*MessageRepo) FindDaoUpdateSettings ¶ added in v0.5.3
func (r *MessageRepo) FindDaoUpdateSettings(limit, offset int) ([]string, error)
func (*MessageRepo) FindDeleteProposals ¶ added in v0.5.1
func (r *MessageRepo) FindDeleteProposals(limit, offset int) ([]string, error)
func (*MessageRepo) FindLatestMCI ¶ added in v0.5.1
func (r *MessageRepo) FindLatestMCI() (int, error)
func (*MessageRepo) FindSpacesWithNewVotes ¶ added in v0.5.1
func (r *MessageRepo) FindSpacesWithNewVotes(after time.Time) ([]string, error)
type MessageService ¶ added in v0.5.1
type MessageService struct {
// contains filtered or unexported fields
}
func NewMessageService ¶ added in v0.5.1
func NewMessageService(repo *MessageRepo, publisher Publisher) *MessageService
func (*MessageService) FindDaoUpdateSettings ¶ added in v0.5.3
func (s *MessageService) FindDaoUpdateSettings(limit, offset int) ([]string, error)
func (*MessageService) FindDeleteProposals ¶ added in v0.5.1
func (s *MessageService) FindDeleteProposals(limit, offset int) ([]string, error)
func (*MessageService) FindSpacesWithNewVotes ¶ added in v0.5.1
func (s *MessageService) FindSpacesWithNewVotes(after time.Time) ([]string, error)
func (*MessageService) GetLatestMCI ¶ added in v0.5.1
func (s *MessageService) GetLatestMCI() (int, error)
func (*MessageService) Upsert ¶ added in v0.5.1
func (s *MessageService) Upsert(message ...*Message) error
type MessageType ¶ added in v0.5.1
type MessageType string
const ( VoteMessage MessageType = "vote" ProposalMessage MessageType = "proposal" InvalidProposalMessage MessageType = "invalid-proposal" ArchiveProposalMessage MessageType = "archive-proposal" DeleteProposalMessage MessageType = "delete-proposal" SettingsMessage MessageType = "settings" )
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) GetFinishedShutterProposals ¶ added in v0.6.6
func (r *ProposalRepo) GetFinishedShutterProposals(limit int) ([]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) MarkProposalAsRefetched ¶ added in v0.6.6
func (r *ProposalRepo) MarkProposalAsRefetched(id string) error
func (*ProposalRepo) MarkVotesProcessed ¶
func (r *ProposalRepo) MarkVotesProcessed(id string) error
func (*ProposalRepo) RemoveFetchedVotes ¶ added in v0.6.6
func (r *ProposalRepo) RemoveFetchedVotes(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) GetFinishedShutterProposals ¶ added in v0.6.6
func (s *ProposalService) GetFinishedShutterProposals(limit int) ([]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) MarkAsRefetched ¶ added in v0.6.6
func (s *ProposalService) MarkAsRefetched(id string) error
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) GetLatestVote ¶
func (*VoteRepo) GetLatestVoteByProposal ¶ added in v0.5.1
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() (*Vote, error)
func (*VoteService) GetLatestVoteByProposal ¶ added in v0.5.1
func (s *VoteService) GetLatestVoteByProposal(proposalID string) (*Vote, error)
func (*VoteService) Upsert ¶
func (s *VoteService) Upsert(vote *Vote) error
Click to show internal directories.
Click to hide internal directories.