Documentation
¶
Index ¶
- Constants
- func ConvertDaoToAPI(dao *Dao) *storagepb.DaoInfo
- type ActiveVotesWorker
- type ActivitySinceRangeFilter
- type Categories
- type CategoryFilter
- type Consumer
- type Dao
- type DaoID
- type DaoIDProvider
- type DaoIDRepo
- type DaoIDService
- type DaoIDsFilter
- type DaoList
- type DataProvider
- type Filter
- type NameFilter
- type NewCategoryWorker
- type NotCategoryFilter
- type OrderByFollowersFilter
- type OrderByPopularityIndexFilter
- type OrderByVotersFilter
- type PageFilter
- type PopularCategoryWorker
- type ProposalProvider
- type Publisher
- type Recommendation
- type RecommendationWorker
- type Repo
- func (r *Repo) Create(dao Dao) error
- func (r *Repo) GetByFilters(filters []Filter, count bool) (DaoList, error)
- func (r *Repo) GetByID(id uuid.UUID) (*Dao, error)
- func (r *Repo) GetByName(name string) (*Dao, error)
- func (r *Repo) GetByOriginalID(id string) (*Dao, error)
- func (r *Repo) GetCategories() ([]string, error)
- func (r *Repo) GetCountByFilters(filters []Filter) (int64, error)
- func (r *Repo) GetRecommended() ([]Recommendation, error)
- func (r *Repo) Update(dao Dao) error
- func (r *Repo) UpdateActiveVotes(id uuid.UUID) error
- func (r *Repo) UpdateActiveVotesAll() error
- func (r *Repo) UpdateProposalCnt(id uuid.UUID) error
- type Server
- func (s *Server) GetByFilter(_ context.Context, req *storagepb.DaoByFilterRequest) (*storagepb.DaoByFilterResponse, error)
- func (s *Server) GetByID(_ context.Context, req *storagepb.DaoByIDRequest) (*storagepb.DaoByIDResponse, error)
- func (s *Server) GetRecommendationsList(_ context.Context, _ *storagepb.GetRecommendationsListRequest) (*storagepb.GetRecommendationsListResponse, error)
- func (s *Server) GetTokenChart(_ context.Context, req *storagepb.TokenChartRequest) (*storagepb.TokenChartResponse, error)
- func (s *Server) GetTokenInfo(_ context.Context, req *storagepb.TokenInfoRequest) (*storagepb.TokenInfoResponse, error)
- func (s *Server) GetTopByCategories(ctx context.Context, req *storagepb.TopByCategoriesRequest) (*storagepb.TopByCategoriesResponse, error)
- type Service
- func (s *Service) GetByFilters(filters []Filter) (DaoList, error)
- func (s *Service) GetByID(id uuid.UUID) (*Dao, error)
- func (s *Service) GetDaoByOriginalID(id string) (*Dao, error)
- func (s *Service) GetIDByOriginalID(id string) (uuid.UUID, error)
- func (s *Service) GetTokenChart(id uuid.UUID, period string) (*zerion.ChartData, error)
- func (s *Service) GetTokenInfo(id uuid.UUID) (*zerion.FungibleData, error)
- func (s *Service) GetTopByCategories(_ context.Context, limit int) (map[string]topList, error)
- func (s *Service) HandleActivitySince(_ context.Context, id uuid.UUID) (*Dao, error)
- func (s *Service) HandleDao(ctx context.Context, dao Dao) error
- func (s *Service) PrefillDaoIDs() error
- func (s *Service) ProcessDeletedProposal(_ context.Context, daoID uuid.UUID) error
- func (s *Service) ProcessExistedProposal(_ context.Context, originalDaoID string) error
- func (s *Service) ProcessNewProposal(_ context.Context, originalDaoID string) error
- func (s *Service) ProcessPopularityIndexUpdate(_ context.Context, id uuid.UUID, index float64) error
- func (s *Service) ProcessUniqueVoters(_ context.Context, voters []UniqueVoter) error
- type Strategies
- type Strategy
- type TokenPriceWorker
- type TopDAOCache
- type Treasuries
- type Treasury
- type UniqueVoter
- type UniqueVoterProvider
- type UniqueVoterRepo
- type VerifiedFilter
- type VotersCountWorker
- type Voting
Constants ¶
View Source
const (
MAX_IDS_BY_REQUEST = 100
)
Variables ¶
This section is empty.
Functions ¶
func ConvertDaoToAPI ¶ added in v0.4.0
Types ¶
type ActiveVotesWorker ¶
type ActiveVotesWorker struct {
// contains filtered or unexported fields
}
func NewActiveVotesWorker ¶
func NewActiveVotesWorker(s *Service) *ActiveVotesWorker
type Categories ¶
type Categories []string
type CategoryFilter ¶
type CategoryFilter struct {
Category string
}
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
type Dao ¶
type Dao struct { ID uuid.UUID `gorm:"primary_key"` CreatedAt time.Time UpdatedAt time.Time OriginalID string Name string Private bool About string Avatar string Terms string Location string Website string Twitter string Github string Coingecko string Email string Network string Symbol string Skin string Domain string Strategies Strategies `gorm:"serializer:json"` Voting Voting `gorm:"serializer:json"` Categories Categories `gorm:"serializer:json"` Treasures Treasuries `gorm:"serializer:json"` FollowersCount int ProposalsCount int Guidelines string Template string ParentID *uuid.UUID ActivitySince int VotersCount int PopularityIndex float64 // ActiveVotes the number of active proposals ActiveVotes int // ActiveProposalsIDs the list of active proposals identifiers ActiveProposalsIDs []string `gorm:"serializer:json"` Verified bool FungibleId string }
type DaoIDProvider ¶
type DaoIDRepo ¶
type DaoIDRepo struct {
// contains filtered or unexported fields
}
func NewDaoIDRepo ¶
type DaoIDService ¶
type DaoIDService struct {
// contains filtered or unexported fields
}
func NewDaoIDService ¶
func NewDaoIDService(repo *DaoIDRepo) *DaoIDService
func (*DaoIDService) GetAll ¶
func (s *DaoIDService) GetAll() ([]DaoID, error)
func (*DaoIDService) GetOrCreate ¶
func (s *DaoIDService) GetOrCreate(originID string) (uuid.UUID, error)
type DaoIDsFilter ¶
type DaoIDsFilter struct {
DaoIDs []string
}
type DataProvider ¶
type DataProvider interface { Create(dao Dao) error Update(dao Dao) error GetByID(id uuid.UUID) (*Dao, error) GetByOriginalID(id string) (*Dao, error) UpdateProposalCnt(id uuid.UUID) error UpdateActiveVotes(id uuid.UUID) error UpdateActiveVotesAll() error GetByFilters(filters []Filter, count bool) (DaoList, error) GetCategories() ([]string, error) GetRecommended() ([]Recommendation, error) }
type NameFilter ¶
type NameFilter struct {
Name string
}
type NewCategoryWorker ¶
type NewCategoryWorker struct {
// contains filtered or unexported fields
}
func NewNewCategoryWorker ¶
func NewNewCategoryWorker(s *Service) *NewCategoryWorker
func (*NewCategoryWorker) ProcessNew ¶
func (w *NewCategoryWorker) ProcessNew(ctx context.Context) error
func (*NewCategoryWorker) RemoveOutdated ¶
func (w *NewCategoryWorker) RemoveOutdated(ctx context.Context) error
type NotCategoryFilter ¶
type NotCategoryFilter struct {
Category string
}
type OrderByFollowersFilter ¶
type OrderByFollowersFilter struct { }
type OrderByPopularityIndexFilter ¶
type OrderByPopularityIndexFilter struct { }
type OrderByVotersFilter ¶
type OrderByVotersFilter struct { }
type PageFilter ¶
type PopularCategoryWorker ¶
type PopularCategoryWorker struct {
// contains filtered or unexported fields
}
func NewPopularCategoryWorker ¶
func NewPopularCategoryWorker(s *Service) *PopularCategoryWorker
type ProposalProvider ¶
type Recommendation ¶ added in v0.1.13
type RecommendationWorker ¶ added in v0.1.13
type RecommendationWorker struct {
// contains filtered or unexported fields
}
func NewRecommendationWorker ¶ added in v0.1.13
func NewRecommendationWorker(s *Service) *RecommendationWorker
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) GetByFilters ¶
func (*Repo) GetCategories ¶
func (*Repo) GetCountByFilters ¶ added in v0.1.8
func (*Repo) GetRecommended ¶ added in v0.1.13
func (r *Repo) GetRecommended() ([]Recommendation, error)
GetRecommended returns the list of available dao strategies in our system
func (*Repo) Update ¶
Update single dao object in database todo: think about updating fields to default value(boolean, string etc)
func (*Repo) UpdateActiveVotesAll ¶
type Server ¶
type Server struct { storagepb.UnimplementedDaoServer // contains filtered or unexported fields }
func (*Server) GetByFilter ¶
func (s *Server) GetByFilter(_ context.Context, req *storagepb.DaoByFilterRequest) (*storagepb.DaoByFilterResponse, error)
func (*Server) GetByID ¶
func (s *Server) GetByID(_ context.Context, req *storagepb.DaoByIDRequest) (*storagepb.DaoByIDResponse, error)
func (*Server) GetRecommendationsList ¶ added in v0.1.13
func (s *Server) GetRecommendationsList( _ context.Context, _ *storagepb.GetRecommendationsListRequest, ) (*storagepb.GetRecommendationsListResponse, error)
func (*Server) GetTokenChart ¶ added in v0.4.4
func (s *Server) GetTokenChart(_ context.Context, req *storagepb.TokenChartRequest) (*storagepb.TokenChartResponse, error)
func (*Server) GetTokenInfo ¶ added in v0.4.4
func (s *Server) GetTokenInfo(_ context.Context, req *storagepb.TokenInfoRequest) (*storagepb.TokenInfoResponse, error)
func (*Server) GetTopByCategories ¶
func (s *Server) GetTopByCategories(ctx context.Context, req *storagepb.TopByCategoriesRequest) (*storagepb.TopByCategoriesResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(r DataProvider, ur UniqueVoterProvider, ip DaoIDProvider, p Publisher, pp ProposalProvider, topDAOCache *TopDAOCache, zerionClient *zerion.Client) (*Service, error)
func (*Service) GetDaoByOriginalID ¶ added in v0.1.25
func (*Service) GetIDByOriginalID ¶
func (*Service) GetTokenChart ¶ added in v0.4.4
func (*Service) GetTokenInfo ¶ added in v0.4.4
func (*Service) GetTopByCategories ¶
func (*Service) HandleActivitySince ¶
func (*Service) PrefillDaoIDs ¶
func (*Service) ProcessDeletedProposal ¶ added in v0.1.18
func (*Service) ProcessExistedProposal ¶
func (*Service) ProcessNewProposal ¶
func (*Service) ProcessPopularityIndexUpdate ¶
func (*Service) ProcessUniqueVoters ¶
func (s *Service) ProcessUniqueVoters(_ context.Context, voters []UniqueVoter) error
type Strategies ¶
type Strategies []Strategy
type TokenPriceWorker ¶ added in v0.3.2
type TokenPriceWorker struct {
// contains filtered or unexported fields
}
func NewTokenPriceWorker ¶ added in v0.3.2
func NewTokenPriceWorker(s *Service, z *zerion.Client) *TokenPriceWorker
type TopDAOCache ¶ added in v0.1.10
type TopDAOCache struct {
// contains filtered or unexported fields
}
func NewTopDAOCache ¶ added in v0.1.10
func NewTopDAOCache(repo DataProvider) *TopDAOCache
func (*TopDAOCache) GetTopList ¶ added in v0.1.10
func (w *TopDAOCache) GetTopList(limit uint) map[string]topList
type Treasuries ¶
type Treasuries []Treasury
type UniqueVoter ¶
func (UniqueVoter) TableName ¶
func (UniqueVoter) TableName() string
type UniqueVoterProvider ¶
type UniqueVoterProvider interface { BatchCreate([]UniqueVoter) error UpdateVotersCount() error }
type UniqueVoterRepo ¶
type UniqueVoterRepo struct {
// contains filtered or unexported fields
}
func NewUniqueVoterRepo ¶
func NewUniqueVoterRepo(db *gorm.DB) *UniqueVoterRepo
func (*UniqueVoterRepo) BatchCreate ¶
func (r *UniqueVoterRepo) BatchCreate(data []UniqueVoter) error
func (*UniqueVoterRepo) UpdateVotersCount ¶
func (r *UniqueVoterRepo) UpdateVotersCount() error
type VerifiedFilter ¶ added in v0.1.8
type VerifiedFilter struct { }
type VotersCountWorker ¶
type VotersCountWorker struct {
// contains filtered or unexported fields
}
func NewVotersCountWorker ¶
func NewVotersCountWorker(s *Service) *VotersCountWorker
func (*VotersCountWorker) ProcessNew ¶
func (w *VotersCountWorker) ProcessNew(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.