inbox

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubjectInitAchievement        = "inbox.achievement.init"
	SubjectRecalculateAchievement = "inbox.achievement.recalculate"
)
View Source
const (
	SubjectFeedUpdated         = "inbox.feed.updated"
	SubjectFeedSettingsUpdated = "inbox.feed.settings.updated"
)
View Source
const (
	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"
	DelegateCreateProposal      TimelineAction = "delegate.proposal.created"
	DelegateVotingVoted         TimelineAction = "delegate.voting.voted"
	DelegateVotingSkipVote      TimelineAction = "delegate.voting.skip_vote"

	TypeDao      Type = "dao"
	TypeProposal Type = "proposal"
	TypeDelegate Type = "delegate"
)
View Source
const (
	SubjectPushCreated = "inbox.push.created"
	SubjectPushClicked = "inbox.push.clicked"

	PushVersionV1 = "v1"
	PushVersionV2 = "v2"
)
View Source
const (
	SubjectVoteCreated = "inbox.vote.created"
)

Variables

View Source
var (
	ErrUnsupportedPayload = errors.New("unsupported payload")
	ErrWrongPayload       = errors.New("wrong payload")
)

Functions

This section is empty.

Types

type AchievementInitEvent added in v0.2.2

type AchievementInitEvent struct {
	UserID uuid.UUID `json:"user_id"`
}

type AchievementInitHandler added in v0.2.2

type AchievementInitHandler = events.Handler[AchievementInitEvent]

type AchievementRecalculateEvent added in v0.2.2

type AchievementRecalculateEvent struct {
	UserID uuid.UUID       `json:"user_id"`
	Type   AchievementType `json:"type"`
}

type AchievementRecalculateHandler added in v0.2.2

type AchievementRecalculateHandler = events.Handler[AchievementRecalculateEvent]

type AchievementType added in v0.2.2

type AchievementType string
const (
	AchievementTypeAppInfo AchievementType = "app_info"
	AchievementTypeVote    AchievementType = "vote"
)

type FeedHandler

type FeedHandler = events.Handler[FeedPayload]

type FeedPayload

type FeedPayload struct {
	ID           uuid.UUID      `json:"id"`
	DaoID        uuid.UUID      `json:"dao_id"`
	ProposalID   string         `json:"proposal_id,omitempty"`
	DiscussionID string         `json:"discussion_id,omitempty"`
	Type         Type           `json:"type"`
	Action       TimelineAction `json:"action"`

	Snapshot json.RawMessage `json:"snapshot"`
	Timeline []TimelineItem  `json:"timeline"`
}

func (*FeedPayload) GetDAO

func (f *FeedPayload) GetDAO() (*core.DaoPayload, error)

func (*FeedPayload) GetProposal

func (f *FeedPayload) GetProposal() (*core.ProposalPayload, error)

type FeedSettingsHandler added in v0.2.7

type FeedSettingsHandler = events.Handler[FeedSettingsPayload]

type FeedSettingsPayload added in v0.2.7

type FeedSettingsPayload struct {
	SubscriberID         uuid.UUID `json:"subscriber_id"`
	AutoarchiveAfterDays int       `json:"autoarchive_after_days"`
}

type PushClickHandler

type PushClickHandler = events.Handler[PushClickPayload]

type PushClickPayload

type PushClickPayload struct {
	ID uuid.UUID `json:"id"`
}

type PushHandler

type PushHandler = events.Handler[PushPayload]

type PushPayload

type PushPayload struct {
	Title         string          `json:"title"`
	Body          string          `json:"body"`
	ImageURL      string          `json:"image_url"`
	UserID        uuid.UUID       `json:"user_id"`
	Version       PushVersion     `json:"version,omitempty"`
	CustomPayload json.RawMessage `json:"custom_payload,omitempty"`
}

type PushVersion

type PushVersion string

type TimelineAction

type TimelineAction string

type TimelineItem

type TimelineItem struct {
	CreatedAt time.Time      `json:"created_at"`
	Action    TimelineAction `json:"action"`
}

type Type

type Type string

type VoteHandler added in v0.2.7

type VoteHandler = events.Handler[VotePayload]

type VotePayload added in v0.2.7

type VotePayload struct {
	UserID     uuid.UUID `json:"user_id"`
	DaoID      string    `json:"dao_id"`
	ProposalID string    `json:"proposal_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL