Documentation ¶
Index ¶
- type Consumer
- type DaoFilter
- type DaoProvider
- type DaoSearcher
- type Delegate
- type DelegateFilter
- type DelegationDetails
- type Delegations
- type DelegatorFilter
- type EnsResolver
- type Filter
- type GetDelegateProfileRequest
- type GetDelegateProfileResponse
- type GetDelegatesRequest
- type GetDelegatesResponse
- type History
- type OrderByAddressFromFilter
- type OrderByAddressToFilter
- type PageFilter
- type ProfileDelegateItem
- type Proposal
- type Publisher
- type Repo
- func (r *Repo) CallInTx(cb func(tx *gorm.DB) error) error
- func (r *Repo) CreateHistory(tx *gorm.DB, dd History) error
- func (r *Repo) CreateSummary(tx *gorm.DB, sm Summary) error
- func (r *Repo) FindDelegator(daoID, author string) (*Summary, error)
- func (r *Repo) FindDelegatorsByVotes(votes []Vote) ([]summaryByVote, error)
- func (r *Repo) GetByFilters(filters ...Filter) ([]Summary, error)
- func (r *Repo) GetCnt(filters ...Filter) (int64, error)
- func (r *Repo) GetSummaryBlockTimestamp(tx *gorm.DB, addressFrom, daoID string) (int, error)
- func (r *Repo) GetTopDelegatesByAddress(address string, limit int) ([]Summary, error)
- func (r *Repo) GetTopDelegatorsByAddress(address string, limit int) ([]Summary, error)
- func (r *Repo) RemoveSummary(tx *gorm.DB, addressFrom, daoID string) error
- func (r *Repo) UpdateSummaryExpiration(tx *gorm.DB, addressFrom, daoID string, expiration, blockTimestamp int) error
- type Server
- func (s *Server) GetDelegateProfile(ctx context.Context, req *storagepb.GetDelegateProfileRequest) (*storagepb.GetDelegateProfileResponse, error)
- func (s *Server) GetDelegates(ctx context.Context, req *storagepb.GetDelegatesRequest) (*storagepb.GetDelegatesResponse, error)
- func (s *Server) GetDelegatesByDao(_ context.Context, req *storagepb.GetDelegatesByDaoRequest) (*storagepb.GetDelegatesByDaoResponse, error)
- func (s *Server) GetDelegationSummary(ctx context.Context, req *storagepb.GetDelegationSummaryRequest) (*storagepb.GetDelegationSummaryResponse, error)
- func (s *Server) GetDelegatorsByDao(_ context.Context, req *storagepb.GetDelegatorsByDaoRequest) (*storagepb.GetDelegatorsByDaoResponse, error)
- func (s *Server) GetTopDelegates(ctx context.Context, req *storagepb.GetTopDelegatesRequest) (*storagepb.GetTopDelegatesResponse, error)
- func (s *Server) GetTopDelegators(ctx context.Context, req *storagepb.GetTopDelegatorsRequest) (*storagepb.GetTopDelegatorsResponse, error)
- type Service
- func (s *Service) GetByFilters(filters ...Filter) ([]Summary, error)
- func (s *Service) GetCntByFilters(filters ...Filter) (int64, error)
- func (s *Service) GetDelegateProfile(ctx context.Context, request GetDelegateProfileRequest) (GetDelegateProfileResponse, error)
- func (s *Service) GetDelegates(ctx context.Context, request GetDelegatesRequest) (*GetDelegatesResponse, error)
- type Summary
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶ added in v0.3.2
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶ added in v0.3.2
type DaoFilter ¶ added in v0.4.0
type DaoFilter struct {
ID string
}
DaoFilter Who delegate voting power
type DaoProvider ¶
type DaoSearcher ¶ added in v0.4.0
type DelegateFilter ¶ added in v0.4.0
type DelegateFilter struct {
Address string
}
DelegateFilter Whom delegate voting power
type DelegationDetails ¶ added in v0.3.2
type Delegations ¶ added in v0.3.2
type Delegations struct { Details []DelegationDetails Expiration int }
type DelegatorFilter ¶ added in v0.4.0
type DelegatorFilter struct {
Address string
}
DelegatorFilter Who delegate voting power
type EnsResolver ¶
type EnsResolver interface { GetByNames(names []string) ([]ensresolver.EnsName, error) GetByAddresses(addresses []string) ([]ensresolver.EnsName, error) AddRequests(list []string) }
type GetDelegatesRequest ¶
type GetDelegatesResponse ¶
type History ¶ added in v0.3.2
type History struct { Action string AddressFrom string OriginalSpaceID string ChainID string BlockNumber int BlockTimestamp int Delegations Delegations `gorm:"-"` Payload json.RawMessage }
History storing delegate actions history
type OrderByAddressFromFilter ¶ added in v0.4.0
type OrderByAddressFromFilter struct { }
type OrderByAddressToFilter ¶ added in v0.4.0
type OrderByAddressToFilter struct { }
type PageFilter ¶ added in v0.4.0
type ProfileDelegateItem ¶
type Repo ¶ added in v0.3.2
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) CreateHistory ¶ added in v0.3.2
CreateHistory creates one history info
func (*Repo) CreateSummary ¶ added in v0.3.2
CreateSummary creates one summary info
func (*Repo) FindDelegator ¶ added in v0.3.2
func (*Repo) FindDelegatorsByVotes ¶ added in v0.3.2
func (*Repo) GetByFilters ¶ added in v0.4.0
func (*Repo) GetSummaryBlockTimestamp ¶ added in v0.3.2
func (*Repo) GetTopDelegatesByAddress ¶ added in v0.4.0
fixme: check it
func (*Repo) GetTopDelegatorsByAddress ¶ added in v0.4.0
fixme: check it
func (*Repo) RemoveSummary ¶ added in v0.3.2
type Server ¶
type Server struct { storagepb.UnimplementedDelegateServer // contains filtered or unexported fields }
func NewServer ¶
func NewServer(sp *Service, ds DaoSearcher) *Server
func (*Server) GetDelegateProfile ¶
func (s *Server) GetDelegateProfile(ctx context.Context, req *storagepb.GetDelegateProfileRequest) (*storagepb.GetDelegateProfileResponse, error)
func (*Server) GetDelegates ¶
func (s *Server) GetDelegates(ctx context.Context, req *storagepb.GetDelegatesRequest) (*storagepb.GetDelegatesResponse, error)
func (*Server) GetDelegatesByDao ¶ added in v0.4.0
func (s *Server) GetDelegatesByDao(_ context.Context, req *storagepb.GetDelegatesByDaoRequest) (*storagepb.GetDelegatesByDaoResponse, error)
func (*Server) GetDelegationSummary ¶ added in v0.4.0
func (s *Server) GetDelegationSummary(ctx context.Context, req *storagepb.GetDelegationSummaryRequest) (*storagepb.GetDelegationSummaryResponse, error)
func (*Server) GetDelegatorsByDao ¶ added in v0.4.0
func (s *Server) GetDelegatorsByDao(_ context.Context, req *storagepb.GetDelegatorsByDaoRequest) (*storagepb.GetDelegatorsByDaoResponse, error)
func (*Server) GetTopDelegates ¶ added in v0.4.0
func (s *Server) GetTopDelegates(ctx context.Context, req *storagepb.GetTopDelegatesRequest) (*storagepb.GetTopDelegatesResponse, error)
func (*Server) GetTopDelegators ¶ added in v0.4.0
func (s *Server) GetTopDelegators(ctx context.Context, req *storagepb.GetTopDelegatorsRequest) (*storagepb.GetTopDelegatorsResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repo, dc delegatepb.DelegateClient, daoProvider DaoProvider, ensResolver EnsResolver, ep Publisher) *Service
func (*Service) GetByFilters ¶ added in v0.4.0
func (*Service) GetCntByFilters ¶ added in v0.4.0
func (*Service) GetDelegateProfile ¶
func (s *Service) GetDelegateProfile(ctx context.Context, request GetDelegateProfileRequest) (GetDelegateProfileResponse, error)
func (*Service) GetDelegates ¶
func (s *Service) GetDelegates(ctx context.Context, request GetDelegatesRequest) (*GetDelegatesResponse, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.