Documentation ¶
Index ¶
- Variables
- type Consumer
- type DaoProvider
- type DataProvider
- type EnsResolver
- type Filter
- type List
- type PageFilter
- type PrepareRequest
- type PrepareResponse
- type ProposalIDsFilter
- type Publisher
- type Relayer
- type Repo
- type ResolvedAddress
- type Server
- func (s *Server) GetDaosVotedIn(_ context.Context, req *storagepb.DaosVotedInRequest) (*storagepb.DaosVotedInResponse, error)
- func (s *Server) GetVotes(_ context.Context, req *storagepb.VotesFilterRequest) (*storagepb.VotesFilterResponse, error)
- func (s *Server) Prepare(ctx context.Context, req *storagepb.PrepareRequest) (*storagepb.PrepareResponse, error)
- func (s *Server) Validate(ctx context.Context, req *storagepb.ValidateRequest) (*storagepb.ValidateResponse, error)
- func (s *Server) Vote(ctx context.Context, req *storagepb.VoteRequest) (*storagepb.VoteResponse, error)
- type Service
- func (s *Service) FetchAndStoreVote(ctx context.Context, id string)
- func (s *Service) GetByFilters(filters []Filter) (List, error)
- func (s *Service) GetDaosVotedIn(voter string) ([]string, error)
- func (s *Service) HandleResolvedAddresses(list []ResolvedAddress) error
- func (s *Service) HandleVotes(ctx context.Context, votes []Vote) error
- func (s *Service) Prepare(ctx context.Context, req PrepareRequest) (PrepareResponse, error)
- func (s *Service) Validate(ctx context.Context, req ValidateRequest) (ValidateResponse, error)
- func (s *Service) Vote(ctx context.Context, req VoteRequest) (VoteResponse, error)
- type Totals
- type ValidateRequest
- type ValidateResponse
- type ValidationError
- type Vote
- type VoteRequest
- type VoteResponse
- type VoterFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OrderByVp = proposal.Order{ Field: "vp", Direction: proposal.DirectionDesc, } OrderByCreated = proposal.Order{ Field: "created", Direction: proposal.DirectionDesc, } )
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
type DataProvider ¶
type EnsResolver ¶
type EnsResolver interface {
AddRequests(list []string)
}
type PageFilter ¶
type PrepareRequest ¶
type PrepareRequest struct { Voter string Proposal string Choice json.RawMessage Reason *string }
type PrepareResponse ¶
type ProposalIDsFilter ¶
type ProposalIDsFilter struct {
ProposalIDs []string
}
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) BatchCreate ¶
BatchCreate creates votes in batch
func (*Repo) UpdateVotes ¶
func (r *Repo) UpdateVotes(list []ResolvedAddress) error
type ResolvedAddress ¶
type Server ¶
type Server struct { storagepb.UnimplementedVoteServer // contains filtered or unexported fields }
func (*Server) GetDaosVotedIn ¶ added in v0.1.9
func (s *Server) GetDaosVotedIn(_ context.Context, req *storagepb.DaosVotedInRequest) (*storagepb.DaosVotedInResponse, error)
func (*Server) GetVotes ¶
func (s *Server) GetVotes(_ context.Context, req *storagepb.VotesFilterRequest) (*storagepb.VotesFilterResponse, error)
func (*Server) Prepare ¶
func (s *Server) Prepare(ctx context.Context, req *storagepb.PrepareRequest) (*storagepb.PrepareResponse, error)
func (*Server) Validate ¶
func (s *Server) Validate(ctx context.Context, req *storagepb.ValidateRequest) (*storagepb.ValidateResponse, error)
func (*Server) Vote ¶
func (s *Server) Vote(ctx context.Context, req *storagepb.VoteRequest) (*storagepb.VoteResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( r DataProvider, dp DaoProvider, p Publisher, er EnsResolver, dsClient votingpb.VotingClient, ) (*Service, error)
func (*Service) FetchAndStoreVote ¶ added in v0.1.4
func (*Service) GetDaosVotedIn ¶ added in v0.1.9
func (*Service) HandleResolvedAddresses ¶
func (s *Service) HandleResolvedAddresses(list []ResolvedAddress) error
func (*Service) HandleVotes ¶
func (*Service) Prepare ¶
func (s *Service) Prepare(ctx context.Context, req PrepareRequest) (PrepareResponse, error)
func (*Service) Validate ¶
func (s *Service) Validate(ctx context.Context, req ValidateRequest) (ValidateResponse, error)
func (*Service) Vote ¶
func (s *Service) Vote(ctx context.Context, req VoteRequest) (VoteResponse, error)
type ValidateRequest ¶
type ValidateResponse ¶
type ValidateResponse struct { OK bool VotingPower float64 ValidationError *ValidationError }
type ValidationError ¶
type Vote ¶
type Vote struct { ID string `gorm:"primary_key"` CreatedAt time.Time UpdatedAt time.Time Ipfs string OriginalDaoID string `gorm:"-"` DaoID uuid.UUID ProposalID string Voter string EnsName string Created int Reason string Choice json.RawMessage App string Vp float64 VpByStrategy []float64 `gorm:"serializer:json"` VpState string }
type VoteRequest ¶
type VoteResponse ¶
type VoterFilter ¶
type VoterFilter struct {
Voter string
}
Click to show internal directories.
Click to hide internal directories.