Documentation ¶
Index ¶
- Constants
- type ActionFilter
- type ActiveFilter
- type DaoConsumer
- type DaoIDFilter
- type DataProvider
- type FeedItem
- type FeedList
- type Filter
- type OrderByTriggeredFilter
- type PageFilter
- type ProposalConsumer
- type Publisher
- type Repo
- type Server
- type Service
- func (s *Service) GetByFilters(filters []Filter) (FeedList, error)
- func (s *Service) GetDaoItem(_ context.Context, id uuid.UUID) (*FeedItem, error)
- func (s *Service) GetProposalItem(_ context.Context, id string) (*FeedItem, error)
- func (s *Service) HandleItem(ctx context.Context, item *FeedItem, sendUpdates bool) error
- type SkipCanceled
- type SkipSpammed
- type SortedByActuality
- type SubscriberProvider
- type SubscriptionProvider
- type Timeline
- func (t *Timeline) AddNonUniqueAction(createdAt time.Time, action TimelineAction)
- func (t *Timeline) AddUniqueAction(createdAt time.Time, action TimelineAction) (isNew bool)
- func (t *Timeline) ContainsAction(action TimelineAction) bool
- func (t *Timeline) LastAction() TimelineAction
- func (t *Timeline) Sort()
- type TimelineAction
- type TimelineItem
- type Type
- type TypeFilter
Constants ¶
View Source
const ( TypeDao Type = "dao" TypeProposal Type = "proposal" None TimelineAction = "" DaoCreated TimelineAction = "dao.created" DaoUpdated TimelineAction = "dao.updated" ProposalCreated TimelineAction = "proposal.created" ProposalUpdated TimelineAction = "proposal.updated" ProposalVotingStartsSoon TimelineAction = "proposal.voting.starts_soon" ProposalVotingEndsSoon TimelineAction = "proposal.voting.ends_soon" ProposalVotingStarted TimelineAction = "proposal.voting.started" ProposalVotingQuorumReached TimelineAction = "proposal.voting.quorum_reached" ProposalVotingEnded TimelineAction = "proposal.voting.ended" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionFilter ¶
type ActionFilter struct {
Actions []string
}
type ActiveFilter ¶
type ActiveFilter struct {
IsActive bool
}
type DaoConsumer ¶
type DaoConsumer struct {
// contains filtered or unexported fields
}
func NewDaoConsumer ¶
func NewDaoConsumer(nc *nats.Conn, s *Service) (*DaoConsumer, error)
type DaoIDFilter ¶
type DaoIDFilter struct {
IDs []string
}
type DataProvider ¶
type FeedItem ¶
type FeedItem struct { ID uuid.UUID `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` TriggeredAt time.Time `gorm:"index"` DaoID uuid.UUID ProposalID string DiscussionID string Type Type Action TimelineAction Snapshot json.RawMessage Timeline Timeline `gorm:"serializer:json"` }
type OrderByTriggeredFilter ¶
type OrderByTriggeredFilter struct { }
type PageFilter ¶
type ProposalConsumer ¶
type ProposalConsumer struct {
// contains filtered or unexported fields
}
func NewProposalConsumer ¶
func NewProposalConsumer(nc *nats.Conn, s *Service) (*ProposalConsumer, error)
type Server ¶
type Server struct { feedpb.UnimplementedFeedServer // contains filtered or unexported fields }
func (*Server) GetByFilter ¶
func (s *Server) GetByFilter(_ context.Context, req *feedpb.FeedByFilterRequest) (*feedpb.FeedByFilterResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(r DataProvider, p Publisher, sub SubscriberProvider, sp SubscriptionProvider) (*Service, error)
func (*Service) GetDaoItem ¶
func (*Service) GetProposalItem ¶
type SkipCanceled ¶
type SkipCanceled struct { }
type SkipSpammed ¶
type SkipSpammed struct { }
type SortedByActuality ¶
type SortedByActuality struct { }
type SubscriberProvider ¶
type SubscriberProvider interface {
GetByID(_ context.Context, id uuid.UUID) (*subscriber.Subscriber, error)
}
type SubscriptionProvider ¶
type Timeline ¶
type Timeline []TimelineItem
func (*Timeline) AddNonUniqueAction ¶
func (t *Timeline) AddNonUniqueAction(createdAt time.Time, action TimelineAction)
func (*Timeline) AddUniqueAction ¶
func (t *Timeline) AddUniqueAction(createdAt time.Time, action TimelineAction) (isNew bool)
func (*Timeline) ContainsAction ¶
func (t *Timeline) ContainsAction(action TimelineAction) bool
func (*Timeline) LastAction ¶
func (t *Timeline) LastAction() TimelineAction
type TimelineAction ¶
type TimelineAction string
func (TimelineAction) Equals ¶
func (a TimelineAction) Equals(action TimelineAction) bool
type TimelineItem ¶
type TimelineItem struct { CreatedAt time.Time `json:"created_at"` Action TimelineAction `json:"action"` }
type TypeFilter ¶
type TypeFilter struct {
Types []string
}
Click to show internal directories.
Click to hide internal directories.