notifications

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(client *rpc.Client, db *mgo.Database, opts ...Option) (*blockfetcher.Context, error)

Types

type BlockProcessor

type BlockProcessor struct {
	// contains filtered or unexported fields
}

func New

func New(client *rpc.Client, db *mgo.Database, opts ...Option) (*BlockProcessor, error)

func (*BlockProcessor) BlockRange

func (processor *BlockProcessor) BlockRange() (from, to uint32)

func (*BlockProcessor) DispatchAccountUpdatedEvent added in v0.4.0

func (processor *BlockProcessor) DispatchAccountUpdatedEvent(userId string, event *events.AccountUpdated)

func (*BlockProcessor) DispatchAccountWitnessVotedEvent added in v0.8.0

func (processor *BlockProcessor) DispatchAccountWitnessVotedEvent(
	userId string,
	event *events.AccountWitnessVoted,
)

func (*BlockProcessor) DispatchCommentPublishedEvent

func (processor *BlockProcessor) DispatchCommentPublishedEvent(userId string, event *events.CommentPublished)

func (*BlockProcessor) DispatchCommentVotedEvent

func (processor *BlockProcessor) DispatchCommentVotedEvent(userId string, event *events.CommentVoted)

func (*BlockProcessor) DispatchStoryPublishedEvent

func (processor *BlockProcessor) DispatchStoryPublishedEvent(userId string, event *events.StoryPublished)

func (*BlockProcessor) DispatchStoryVotedEvent

func (processor *BlockProcessor) DispatchStoryVotedEvent(userId string, event *events.StoryVoted)

func (*BlockProcessor) DispatchTransferMadeEvent added in v0.3.0

func (processor *BlockProcessor) DispatchTransferMadeEvent(userId string, event *events.TransferMade)

func (*BlockProcessor) DispatchUserFollowStatusChangedEvent added in v0.7.0

func (processor *BlockProcessor) DispatchUserFollowStatusChangedEvent(
	userId string,
	event *events.UserFollowStatusChanged,
)

func (*BlockProcessor) DispatchUserMentionedEvent added in v0.2.0

func (processor *BlockProcessor) DispatchUserMentionedEvent(userId string, event *events.UserMentioned)

func (*BlockProcessor) Finalize

func (processor *BlockProcessor) Finalize() error

func (*BlockProcessor) HandleAccountUpdatedEvent added in v0.4.0

func (processor *BlockProcessor) HandleAccountUpdatedEvent(event *events.AccountUpdated) error

func (*BlockProcessor) HandleAccountWitnessVotedEvent added in v0.8.0

func (processor *BlockProcessor) HandleAccountWitnessVotedEvent(event *events.AccountWitnessVoted) error

func (*BlockProcessor) HandleCommentPublishedEvent

func (processor *BlockProcessor) HandleCommentPublishedEvent(event *events.CommentPublished) error

func (*BlockProcessor) HandleCommentVotedEvent

func (processor *BlockProcessor) HandleCommentVotedEvent(event *events.CommentVoted) error

func (*BlockProcessor) HandleStoryPublishedEvent

func (processor *BlockProcessor) HandleStoryPublishedEvent(event *events.StoryPublished) error

func (*BlockProcessor) HandleStoryVotedEvent

func (processor *BlockProcessor) HandleStoryVotedEvent(event *events.StoryVoted) error

func (*BlockProcessor) HandleTransferMadeEvent added in v0.3.0

func (processor *BlockProcessor) HandleTransferMadeEvent(event *events.TransferMade) error

func (*BlockProcessor) HandleUserFollowStatusChangedEvent added in v0.7.0

func (processor *BlockProcessor) HandleUserFollowStatusChangedEvent(
	event *events.UserFollowStatusChanged,
) error

func (*BlockProcessor) HandleUserMentionedEvent added in v0.2.0

func (processor *BlockProcessor) HandleUserMentionedEvent(event *events.UserMentioned) error

func (*BlockProcessor) ProcessBlock

func (processor *BlockProcessor) ProcessBlock(block *database.Block) error

type BlockProcessorConfig

type BlockProcessorConfig struct {
	NextBlockNum       uint32     `bson:"nextBlockNum"`
	LastBlockTimestamp *time.Time `bson:"lastBlockTimestamp,omitempty"`
}

func (*BlockProcessorConfig) Clone added in v0.4.0

func (config *BlockProcessorConfig) Clone() *BlockProcessorConfig

type EventMiner

type EventMiner interface {
	MineEvent(*database.Operation, *database.Content) (events []interface{}, err error)
}

type Notifier

type Notifier interface {
	DispatchAccountUpdatedEvent(userId string, userSettings bson.Raw, event *events.AccountUpdated) error
	DispatchAccountWitnessVotedEvent(userId string, userSettings bson.Raw, event *events.AccountWitnessVoted) error
	DispatchTransferMadeEvent(userId string, userSettings bson.Raw, event *events.TransferMade) error
	DispatchUserMentionedEvent(userId string, userSettings bson.Raw, event *events.UserMentioned) error
	DispatchUserFollowStatusChangedEvent(userId string, userSettings bson.Raw, event *events.UserFollowStatusChanged) error
	DispatchStoryPublishedEvent(userId string, userSettings bson.Raw, event *events.StoryPublished) error
	DispatchStoryVotedEvent(userId string, userSettings bson.Raw, event *events.StoryVoted) error
	DispatchCommentPublishedEvent(userId string, userSettings bson.Raw, event *events.CommentPublished) error
	DispatchCommentVotedEvent(userId string, userSettings bson.Raw, event *events.CommentVoted) error

	io.Closer
}

type NotifierDoc

type NotifierDoc struct {
	NotifierId string   `bson:"notifierId"`
	Settings   bson.Raw `bson:"settings"`
}

type Option added in v0.5.0

type Option func(*BlockProcessor)

func AddNotifier added in v0.5.0

func AddNotifier(id string, notifier Notifier) Option

Directories

Path Synopsis
notifiers

Jump to

Keyboard shortcuts

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