Documentation
¶
Index ¶
- Variables
- type ActiveDaoProposalTotals
- type AnalyticsItem
- type Bin
- type Bucket
- type Categories
- type Choices
- type DaoVoters
- type DataProvider
- type EcosystemTotals
- type EventType
- type ExclusiveVoters
- type FinalProposalCounts
- type MonthlyActiveUser
- type MonthlyTotal
- type MonthlyUser
- type MutualDao
- type PopularityWorker
- type ProposalsByMonth
- type Publisher
- type Repo
- func (r *Repo) GetDaoProposalForPeriod(period uint8) (map[uuid.UUID]float64, error)
- func (r *Repo) GetDaoProposalTotalsForPeriods(periodInDays uint32) (*ActiveDaoProposalTotals, error)
- func (r *Repo) GetDaoVotersForPeriod(period uint8) (map[uuid.UUID]float64, error)
- func (r *Repo) GetDaoVotesForPeriod(period uint8) (map[uuid.UUID]float64, error)
- func (r *Repo) GetDaos() ([]uuid.UUID, error)
- func (r *Repo) GetExclusiveVotersByDaoId(id uuid.UUID) (*ExclusiveVoters, error)
- func (r *Repo) GetGoverlandIndexAdditives() (map[uuid.UUID]float64, error)
- func (r *Repo) GetMonthlyActiveUsersByDaoId(id uuid.UUID, period uint32) ([]*MonthlyActiveUser, error)
- func (r *Repo) GetMonthlyDaos() ([]*MonthlyTotal, error)
- func (r *Repo) GetMonthlyNewProposalsByDaoId(id uuid.UUID, period uint32) ([]*ProposalsByMonth, error)
- func (r *Repo) GetMonthlyProposals() ([]*MonthlyTotal, error)
- func (r *Repo) GetMonthlyVoters() ([]*MonthlyTotal, error)
- func (r *Repo) GetMutualDaos(id uuid.UUID, limit uint64) ([]*DaoVoters, error)
- func (r *Repo) GetProposalsCountByDaoId(id uuid.UUID) (*FinalProposalCounts, error)
- func (r *Repo) GetTokenPrice(id uuid.UUID) (float32, error)
- func (r *Repo) GetTopVotersByVp(id uuid.UUID, offset int, limit int, period uint32) ([]*VoterWithVp, error)
- func (r *Repo) GetTotalVpAvgForActiveVoters(id uuid.UUID, period uint32) (*VpAvgTotal, error)
- func (r *Repo) GetVoterBucketsByDaoId(id uuid.UUID) ([]*Bucket, error)
- func (r *Repo) GetVoterTotalsForPeriods(periodInDays uint32) (*VoterTotals, error)
- func (r *Repo) GetVotesGroupsByDaoId(id uuid.UUID) ([]*Bucket, error)
- func (r *Repo) GetVpAvgList(id uuid.UUID, period uint32, price float32) ([]float32, error)
- type Scores
- type Server
- func (s *Server) GetAvgVpList(_ context.Context, req *internalapi.GetAvgVpListRequest) (*internalapi.GetAvgVpListResponse, error)
- func (s *Server) GetDaosVotersParticipateIn(_ context.Context, req *internalapi.DaosVotersParticipateInRequest) (*internalapi.DaosVotersParticipateInResponse, error)
- func (s *Server) GetExclusiveVoters(_ context.Context, req *internalapi.ExclusiveVotersRequest) (*internalapi.ExclusiveVotersResponse, error)
- func (s *Server) GetMonthlyActive(_ context.Context, req *internalapi.MonthlyActiveRequest) (*internalapi.MonthlyActiveResponse, error)
- func (s *Server) GetMonthlyActiveUsers(_ context.Context, req *internalapi.MonthlyActiveUsersRequest) (*internalapi.MonthlyActiveUsersResponse, error)
- func (s *Server) GetMonthlyNewProposals(_ context.Context, req *internalapi.MonthlyNewProposalsRequest) (*internalapi.MonthlyNewProposalsResponse, error)
- func (s *Server) GetSucceededProposalsCount(_ context.Context, req *internalapi.SucceededProposalsCountRequest) (*internalapi.SucceededProposalsCountResponse, error)
- func (s *Server) GetTopVotersByVp(_ context.Context, req *internalapi.TopVotersByVpRequest) (*internalapi.TopVotersByVpResponse, error)
- func (s *Server) GetTotalsForLastPeriods(_ context.Context, req *internalapi.TotalsForLastPeriodsRequest) (*internalapi.TotalsForLastPeriodsResponse, error)
- func (s *Server) GetVoterBuckets(_ context.Context, req *internalapi.VoterBucketsRequest) (*internalapi.VoterBucketsResponse, error)
- func (s *Server) GetVoterBucketsV2(_ context.Context, req *internalapi.VoterBucketsRequestV2) (*internalapi.VoterBucketsResponse, error)
- type Service
- func (s *Service) GetExclusiveVoters(id uuid.UUID) (*ExclusiveVoters, error)
- func (s *Service) GetMonthlyActiveUsers(id uuid.UUID, period uint32) ([]*MonthlyActiveUser, error)
- func (s *Service) GetMonthlyDaos() ([]*MonthlyTotal, error)
- func (s *Service) GetMonthlyNewProposals(id uuid.UUID, period uint32) ([]*ProposalsByMonth, error)
- func (s *Service) GetMonthlyProposals() ([]*MonthlyTotal, error)
- func (s *Service) GetMonthlyVoters() ([]*MonthlyTotal, error)
- func (s *Service) GetMutualDaos(id uuid.UUID, limit uint64) ([]*MutualDao, error)
- func (s *Service) GetSucceededProposalsCount(id uuid.UUID) (*FinalProposalCounts, error)
- func (s *Service) GetTopVotersByVp(id uuid.UUID, offset uint32, limit uint32, period uint32) ([]*VoterWithVp, error)
- func (s *Service) GetTotalVpAvg(id uuid.UUID, period uint32) (*VpAvgTotal, error)
- func (s *Service) GetTotalsForLastPeriods(period uint32) (*EcosystemTotals, error)
- func (s *Service) GetVoterBuckets(id uuid.UUID) ([]*Bucket, error)
- func (s *Service) GetVotesGroups(id uuid.UUID) ([]*Bucket, error)
- func (s *Service) GetVpAvgList(id uuid.UUID, period uint32, minBalance float32) (*VpHistogram, error)
- type Strategies
- type Strategy
- type TotalForDaos
- type TotalsForTwoPeriods
- type VoterTotals
- type VoterWithVp
- type VpAvgTotal
- type VpHistogram
Constants ¶
This section is empty.
Variables ¶
View Source
var BucketMinVotes = map[uint32]string{
1: "1",
2: "2",
3: "3-4",
4: "5-7",
5: "8-12",
6: "13+",
}
Functions ¶
This section is empty.
Types ¶
type ActiveDaoProposalTotals ¶
type AnalyticsItem ¶
type AnalyticsItem struct { DaoID uuid.UUID `json:"dao_id"` EventType EventType `json:"event_type"` EventTime time.Time `json:"event_time"` CreatedAt int `json:"created_at"` ProposalID string `json:"proposal_id"` Voter string `json:"voter"` Network string `json:"network"` Strategies []events.StrategyPayload `json:"strategies"` Categories Categories `json:"categories"` FollowersCount int `json:"followers_count"` ProposalsCount int `json:"proposals_count"` Author string `json:"author"` Type string `json:"type"` Title string `json:"title"` Body string `json:"body"` Choices Choices `json:"choices"` Start int `json:"start"` End int `json:"end"` Quorum float64 `json:"quorum"` State string `json:"state"` Scores Scores `json:"scores"` ScoresState string `json:"scores_state"` ScoresTotal float32 `json:"scores_total"` ScoresUpdated int `json:"scores_updated"` Votes int `json:"votes"` App string `json:"app"` Choice int `json:"choice"` Vp float64 `json:"vp"` VpByStrategy []float64 `json:"vp_by_strategy"` VpState string `json:"vp_state"` }
type Categories ¶
type Categories []string
type DataProvider ¶
type DataProvider interface { GetMonthlyActiveUsersByDaoId(id uuid.UUID, period uint32) ([]*MonthlyActiveUser, error) GetVoterBucketsByDaoId(id uuid.UUID) ([]*Bucket, error) GetVotesGroupsByDaoId(id uuid.UUID) ([]*Bucket, error) GetExclusiveVotersByDaoId(id uuid.UUID) (*ExclusiveVoters, error) GetMonthlyNewProposalsByDaoId(id uuid.UUID, period uint32) ([]*ProposalsByMonth, error) GetProposalsCountByDaoId(id uuid.UUID) (*FinalProposalCounts, error) GetMutualDaos(id uuid.UUID, limit uint64) ([]*DaoVoters, error) GetTopVotersByVp(id uuid.UUID, limit int, offset int, period uint32) ([]*VoterWithVp, error) GetTotalVpAvgForActiveVoters(id uuid.UUID, period uint32) (*VpAvgTotal, error) GetVoterTotalsForPeriods(periodInDays uint32) (*VoterTotals, error) GetDaoProposalTotalsForPeriods(periodInDays uint32) (*ActiveDaoProposalTotals, error) GetMonthlyDaos() ([]*MonthlyTotal, error) GetMonthlyProposals() ([]*MonthlyTotal, error) GetMonthlyVoters() ([]*MonthlyTotal, error) GetDaoProposalForPeriod(period uint8) (map[uuid.UUID]float64, error) GetDaoVotersForPeriod(period uint8) (map[uuid.UUID]float64, error) GetDaoVotesForPeriod(period uint8) (map[uuid.UUID]float64, error) GetGoverlandIndexAdditives() (map[uuid.UUID]float64, error) GetDaos() ([]uuid.UUID, error) GetVpAvgList(id uuid.UUID, period uint32, price float32) ([]float32, error) GetTokenPrice(id uuid.UUID) (float32, error) }
type EcosystemTotals ¶
type EcosystemTotals struct { Daos TotalsForTwoPeriods Proposals TotalsForTwoPeriods Voters TotalsForTwoPeriods Votes TotalsForTwoPeriods }
type ExclusiveVoters ¶
type FinalProposalCounts ¶
type MonthlyActiveUser ¶
type MonthlyTotal ¶
type MonthlyUser ¶
type PopularityWorker ¶
type PopularityWorker struct {
// contains filtered or unexported fields
}
func NewPopularityWorker ¶
func NewPopularityWorker(s *Service) *PopularityWorker
type ProposalsByMonth ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) GetDaoProposalForPeriod ¶
func (*Repo) GetDaoProposalTotalsForPeriods ¶
func (r *Repo) GetDaoProposalTotalsForPeriods(periodInDays uint32) (*ActiveDaoProposalTotals, error)
func (*Repo) GetDaoVotersForPeriod ¶
func (*Repo) GetDaoVotesForPeriod ¶
func (*Repo) GetExclusiveVotersByDaoId ¶
func (r *Repo) GetExclusiveVotersByDaoId(id uuid.UUID) (*ExclusiveVoters, error)
func (*Repo) GetGoverlandIndexAdditives ¶
func (*Repo) GetMonthlyActiveUsersByDaoId ¶
func (*Repo) GetMonthlyDaos ¶
func (r *Repo) GetMonthlyDaos() ([]*MonthlyTotal, error)
func (*Repo) GetMonthlyNewProposalsByDaoId ¶
func (*Repo) GetMonthlyProposals ¶
func (r *Repo) GetMonthlyProposals() ([]*MonthlyTotal, error)
func (*Repo) GetMonthlyVoters ¶
func (r *Repo) GetMonthlyVoters() ([]*MonthlyTotal, error)
func (*Repo) GetMutualDaos ¶
func (*Repo) GetProposalsCountByDaoId ¶
func (r *Repo) GetProposalsCountByDaoId(id uuid.UUID) (*FinalProposalCounts, error)
func (*Repo) GetTopVotersByVp ¶
func (*Repo) GetTotalVpAvgForActiveVoters ¶
func (*Repo) GetVoterBucketsByDaoId ¶
func (*Repo) GetVoterTotalsForPeriods ¶
func (r *Repo) GetVoterTotalsForPeriods(periodInDays uint32) (*VoterTotals, error)
func (*Repo) GetVotesGroupsByDaoId ¶
type Server ¶
type Server struct { internalapi.UnimplementedAnalyticsServer // contains filtered or unexported fields }
func (*Server) GetAvgVpList ¶
func (s *Server) GetAvgVpList(_ context.Context, req *internalapi.GetAvgVpListRequest) (*internalapi.GetAvgVpListResponse, error)
func (*Server) GetDaosVotersParticipateIn ¶
func (s *Server) GetDaosVotersParticipateIn(_ context.Context, req *internalapi.DaosVotersParticipateInRequest) (*internalapi.DaosVotersParticipateInResponse, error)
func (*Server) GetExclusiveVoters ¶
func (s *Server) GetExclusiveVoters(_ context.Context, req *internalapi.ExclusiveVotersRequest) (*internalapi.ExclusiveVotersResponse, error)
func (*Server) GetMonthlyActive ¶
func (s *Server) GetMonthlyActive(_ context.Context, req *internalapi.MonthlyActiveRequest) (*internalapi.MonthlyActiveResponse, error)
func (*Server) GetMonthlyActiveUsers ¶
func (s *Server) GetMonthlyActiveUsers(_ context.Context, req *internalapi.MonthlyActiveUsersRequest) (*internalapi.MonthlyActiveUsersResponse, error)
func (*Server) GetMonthlyNewProposals ¶
func (s *Server) GetMonthlyNewProposals(_ context.Context, req *internalapi.MonthlyNewProposalsRequest) (*internalapi.MonthlyNewProposalsResponse, error)
func (*Server) GetSucceededProposalsCount ¶
func (s *Server) GetSucceededProposalsCount(_ context.Context, req *internalapi.SucceededProposalsCountRequest) (*internalapi.SucceededProposalsCountResponse, error)
func (*Server) GetTopVotersByVp ¶
func (s *Server) GetTopVotersByVp(_ context.Context, req *internalapi.TopVotersByVpRequest) (*internalapi.TopVotersByVpResponse, error)
func (*Server) GetTotalsForLastPeriods ¶
func (s *Server) GetTotalsForLastPeriods(_ context.Context, req *internalapi.TotalsForLastPeriodsRequest) (*internalapi.TotalsForLastPeriodsResponse, error)
func (*Server) GetVoterBuckets ¶
func (s *Server) GetVoterBuckets(_ context.Context, req *internalapi.VoterBucketsRequest) (*internalapi.VoterBucketsResponse, error)
func (*Server) GetVoterBucketsV2 ¶
func (s *Server) GetVoterBucketsV2(_ context.Context, req *internalapi.VoterBucketsRequestV2) (*internalapi.VoterBucketsResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(p Publisher, r DataProvider) (*Service, error)
func (*Service) GetExclusiveVoters ¶
func (s *Service) GetExclusiveVoters(id uuid.UUID) (*ExclusiveVoters, error)
func (*Service) GetMonthlyActiveUsers ¶
func (*Service) GetMonthlyDaos ¶
func (s *Service) GetMonthlyDaos() ([]*MonthlyTotal, error)
func (*Service) GetMonthlyNewProposals ¶
func (*Service) GetMonthlyProposals ¶
func (s *Service) GetMonthlyProposals() ([]*MonthlyTotal, error)
func (*Service) GetMonthlyVoters ¶
func (s *Service) GetMonthlyVoters() ([]*MonthlyTotal, error)
func (*Service) GetMutualDaos ¶
func (*Service) GetSucceededProposalsCount ¶
func (s *Service) GetSucceededProposalsCount(id uuid.UUID) (*FinalProposalCounts, error)
func (*Service) GetTopVotersByVp ¶
func (*Service) GetTotalVpAvg ¶
func (*Service) GetTotalsForLastPeriods ¶
func (s *Service) GetTotalsForLastPeriods(period uint32) (*EcosystemTotals, error)
func (*Service) GetVoterBuckets ¶
func (*Service) GetVpAvgList ¶
type Strategies ¶
type Strategies []Strategy
type TotalForDaos ¶
type TotalsForTwoPeriods ¶
type VoterTotals ¶
type VoterWithVp ¶
type VpAvgTotal ¶
Click to show internal directories.
Click to hide internal directories.