whisper/whisperv6/events.go

33 lines
1.1 KiB
Go
Raw Normal View History

2018-09-25 09:21:09 +03:00
package whisperv6
import (
2018-09-25 09:35:03 +03:00
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/p2p/discover"
2018-09-25 09:21:09 +03:00
)
// EventType used to define known envelope events.
type EventType string
const (
2018-09-25 09:35:03 +03:00
// EventEnvelopeSent fires when envelope was sent to a peer.
EventEnvelopeSent EventType = "envelope.sent"
// EventEnvelopeExpired fires when envelop expired
EventEnvelopeExpired EventType = "envelope.expired"
2018-09-25 09:38:44 +03:00
// EventEnvelopeAvailable fires when envelop is available for filters
EventEnvelopeAvailable EventType = "envelope.available"
2018-09-25 09:35:03 +03:00
// EventMailServerRequestCompleted fires after mailserver sends all the requested messages
EventMailServerRequestCompleted EventType = "mailserver.request.completed"
// EventMailServerRequestExpired fires after mailserver the request TTL ends
EventMailServerRequestExpired EventType = "mailserver.request.expired"
2018-09-25 09:38:44 +03:00
// EventMailServerEnvelopeArchived fires after an envelope has been archived
EventMailServerEnvelopeArchived EventType = "mailserver.envelope.archived"
2018-09-25 09:21:09 +03:00
)
// EnvelopeEvent used for envelopes events.
type EnvelopeEvent struct {
2018-09-25 09:35:03 +03:00
Event EventType
Hash common.Hash
Peer discover.NodeID
2018-09-25 09:38:44 +03:00
Data interface{}
2018-09-25 09:21:09 +03:00
}