inbox

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

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"

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

	PushVersionV1 = "v1"
	PushVersionV2 = "v2"
)
View Source
const (
	SubjectFeedUpdated = "inbox.feed.updated"
)

Variables

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

Functions

This section is empty.

Types

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 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

Jump to

Keyboard shortcuts

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