Documentation ¶
Index ¶
- type PublicAPI
- func (api *PublicAPI) RequestMessages(_ context.Context, r ext.MessagesRequest) (types.HexBytes, error)
- func (api *PublicAPI) RequestMessagesSync(conf ext.RetryConfig, r ext.MessagesRequest) (ext.MessagesResponse, error)
- func (api *PublicAPI) SyncMessages(ctx context.Context, r SyncMessagesRequest) (SyncMessagesResponse, error)
- type Service
- type SyncMessagesRequest
- type SyncMessagesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PublicAPI ¶
PublicAPI extends whisper public API.
func NewPublicAPI ¶
NewPublicAPI returns instance of the public API.
func (*PublicAPI) RequestMessages ¶
func (api *PublicAPI) RequestMessages(_ context.Context, r ext.MessagesRequest) (types.HexBytes, error)
RequestMessages sends a request for historic messages to a MailServer.
func (*PublicAPI) RequestMessagesSync ¶ added in v0.35.0
func (api *PublicAPI) RequestMessagesSync(conf ext.RetryConfig, r ext.MessagesRequest) (ext.MessagesResponse, error)
RequestMessagesSync repeats MessagesRequest using configuration in retry conf.
func (*PublicAPI) SyncMessages ¶ added in v0.35.0
func (api *PublicAPI) SyncMessages(ctx context.Context, r SyncMessagesRequest) (SyncMessagesResponse, error)
SyncMessages sends a request to a given MailServerPeer to sync historic messages. MailServerPeers needs to be added as a trusted peer first.
type Service ¶
func New ¶
func New(config params.ShhextConfig, n types.Node, ctx interface{}, handler ext.EnvelopeEventsHandler, ldb *leveldb.DB) *Service
func (*Service) PublicWhisperAPI ¶ added in v0.39.9
func (s *Service) PublicWhisperAPI() types.PublicWhisperAPI
func (*Service) SyncMessages ¶ added in v0.39.9
func (s *Service) SyncMessages(ctx context.Context, mailServerID []byte, r types.SyncMailRequest) (resp types.SyncEventResponse, err error)
type SyncMessagesRequest ¶ added in v0.35.0
type SyncMessagesRequest struct { // MailServerPeer is MailServer's enode address. MailServerPeer string `json:"mailServerPeer"` // From is a lower bound of time range (optional). // Default is 24 hours back from now. From uint32 `json:"from"` // To is a upper bound of time range (optional). // Default is now. To uint32 `json:"to"` // Limit determines the number of messages sent by the mail server // for the current paginated request Limit uint32 `json:"limit"` // Cursor is used as starting point for paginated requests Cursor string `json:"cursor"` // FollowCursor if true loads messages until cursor is empty. FollowCursor bool `json:"followCursor"` // Topics is a list of Whisper topics. // If empty, a full bloom filter will be used. Topics []types.TopicType `json:"topics"` }
SyncMessagesRequest is a SyncMessages() request payload.
type SyncMessagesResponse ¶ added in v0.35.0
type SyncMessagesResponse struct { // Cursor from the response can be used to retrieve more messages // for the previous request. Cursor string `json:"cursor"` // Error indicates that something wrong happened when sending messages // to the requester. Error string `json:"error"` }
SyncMessagesResponse is a response from the mail server to which SyncMessagesRequest was sent.
Click to show internal directories.
Click to hide internal directories.