Documentation ¶
Index ¶
- Variables
- type DebugAPI
- type EnvelopeEventsHandler
- type EnvelopeSignalHandler
- func (h EnvelopeSignalHandler) EnvelopeExpired(hash common.Hash)
- func (h EnvelopeSignalHandler) EnvelopeSent(hash common.Hash)
- func (h EnvelopeSignalHandler) MailServerRequestCompleted(requestID common.Hash, lastEnvelopeHash common.Hash, cursor []byte)
- func (h EnvelopeSignalHandler) MailServerRequestExpired(hash common.Hash)
- type EnvelopeState
- type MessagesRequest
- type PublicAPI
- func (api *PublicAPI) ConfirmMessagesProcessed(messages []*whisper.Message) error
- func (api *PublicAPI) GetNewFilterMessages(filterID string) ([]*whisper.Message, error)
- func (api *PublicAPI) Post(ctx context.Context, req whisper.NewMessage) (hash hexutil.Bytes, err error)
- func (api *PublicAPI) RequestMessages(_ context.Context, r MessagesRequest) (hexutil.Bytes, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidMailServerPeer is returned when it fails to parse enode from params. ErrInvalidMailServerPeer = errors.New("invalid mailServerPeer value") // ErrInvalidSymKeyID is returned when it fails to get a symmetric key. ErrInvalidSymKeyID = errors.New("invalid symKeyID value") // ErrInvalidPublicKey is returned when public key can't be extracted // from MailServer's nodeID. ErrInvalidPublicKey = errors.New("can't extract public key") )
Functions ¶
This section is empty.
Types ¶
type DebugAPI ¶
type DebugAPI struct {
// contains filtered or unexported fields
}
DebugAPI represents a set of APIs from the `web3.debug` namespace.
func NewDebugAPI ¶
NewDebugAPI creates an instance of the debug API.
type EnvelopeEventsHandler ¶
type EnvelopeEventsHandler interface { EnvelopeSent(common.Hash) EnvelopeExpired(common.Hash) MailServerRequestCompleted(common.Hash, common.Hash, []byte) MailServerRequestExpired(common.Hash) }
EnvelopeEventsHandler used for two different event types.
type EnvelopeSignalHandler ¶
type EnvelopeSignalHandler struct{}
EnvelopeSignalHandler sends signals when envelope is sent or expired.
func (EnvelopeSignalHandler) EnvelopeExpired ¶
func (h EnvelopeSignalHandler) EnvelopeExpired(hash common.Hash)
EnvelopeExpired triggered when envelope is expired but wasn't delivered to any peer.
func (EnvelopeSignalHandler) EnvelopeSent ¶
func (h EnvelopeSignalHandler) EnvelopeSent(hash common.Hash)
EnvelopeSent triggered when envelope delivered atleast to 1 peer.
func (EnvelopeSignalHandler) MailServerRequestCompleted ¶
func (h EnvelopeSignalHandler) MailServerRequestCompleted(requestID common.Hash, lastEnvelopeHash common.Hash, cursor []byte)
MailServerRequestCompleted triggered when the mailserver sends a message to notify that the request has been completed
func (EnvelopeSignalHandler) MailServerRequestExpired ¶
func (h EnvelopeSignalHandler) MailServerRequestExpired(hash common.Hash)
MailServerRequestExpired triggered when the mailserver request expires
type EnvelopeState ¶
type EnvelopeState int
EnvelopeState in local tracker
const ( // EnvelopePosted is set when envelope was added to a local whisper queue. EnvelopePosted EnvelopeState = iota // EnvelopeSent is set when envelope is sent to atleast one peer. EnvelopeSent // MailServerRequestSent is set when p2p request is sent to the mailserver MailServerRequestSent )
type MessagesRequest ¶
type MessagesRequest 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"` // Topic is a regular Whisper topic. Topic whisper.TopicType `json:"topic"` // SymKeyID is an ID of a symmetric key to authenticate to MailServer. // It's derived from MailServer password. // // It's also possible to authenticate request with MailServerPeer // public key. SymKeyID string `json:"symKeyID"` // Timeout is the time to live of the request specified in seconds. // Default is 10 seconds Timeout time.Duration `json:"timeout"` }
MessagesRequest is a payload send to a MailServer to get messages.
type PublicAPI ¶
type PublicAPI struct {
// contains filtered or unexported fields
}
PublicAPI extends whisper public API.
func NewPublicAPI ¶
NewPublicAPI returns instance of the public API.
func (*PublicAPI) ConfirmMessagesProcessed ¶
ConfirmMessagesProcessed is a method to confirm that messages was consumed by the client side.
func (*PublicAPI) GetNewFilterMessages ¶
GetNewFilterMessages is a prototype method with deduplication
func (*PublicAPI) Post ¶
func (api *PublicAPI) Post(ctx context.Context, req whisper.NewMessage) (hash hexutil.Bytes, err error)
Post shamelessly copied from whisper codebase with slight modifications.
func (*PublicAPI) RequestMessages ¶
RequestMessages sends a request for historic messages to a MailServer.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a service that provides some additional Whisper API.