mailservice

package
v0.0.0-...-adbc7b5 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mailservice is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
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")
)

Functions

This section is empty.

Types

type MailService

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

MailService is a service that provides some additional Whisper API.

func New

func New(provider ServiceProvider) *MailService

New returns a new MailService.

func (*MailService) APIs

func (s *MailService) APIs() []rpc.API

APIs returns a list of new APIs.

func (*MailService) Protocols

func (s *MailService) Protocols() []p2p.Protocol

Protocols returns a new protocols list. In this case, there are none.

func (*MailService) Start

func (s *MailService) Start(server *p2p.Server) error

Start is run when a service is started. It does nothing in this case but is required by `node.Service` interface.

func (*MailService) Stop

func (s *MailService) Stop() error

Stop is run when a service is stopped. It does nothing in this case but is required by `node.Service` interface.

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

	// 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.
	SymKeyID string `json:"symKeyID"`
}

MessagesRequest is a payload send to a MailServer to get messages.

type MockServiceProvider

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

MockServiceProvider is a mock of ServiceProvider interface

func NewMockServiceProvider

func NewMockServiceProvider(ctrl *gomock.Controller) *MockServiceProvider

NewMockServiceProvider creates a new mock instance

func (*MockServiceProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockServiceProvider) Node

func (m *MockServiceProvider) Node() (*node.Node, error)

Node mocks base method

func (*MockServiceProvider) WhisperService

func (m *MockServiceProvider) WhisperService() (*whisperv5.Whisper, error)

WhisperService mocks base method

type MockServiceProviderMockRecorder

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

MockServiceProviderMockRecorder is the mock recorder for MockServiceProvider

func (*MockServiceProviderMockRecorder) Node

Node indicates an expected call of Node

func (*MockServiceProviderMockRecorder) WhisperService

func (mr *MockServiceProviderMockRecorder) WhisperService() *gomock.Call

WhisperService indicates an expected call of WhisperService

type PublicAPI

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

PublicAPI defines a MailServer public API.

func NewPublicAPI

func NewPublicAPI(provider ServiceProvider) *PublicAPI

NewPublicAPI returns a new PublicAPI.

func (*PublicAPI) RequestMessages

func (api *PublicAPI) RequestMessages(_ context.Context, r MessagesRequest) (bool, error)

RequestMessages sends a request for historic messages to a MailServer.

type ServiceProvider

type ServiceProvider interface {
	Node() (*node.Node, error)
	WhisperService() (*whisper.Whisper, error)
}

ServiceProvider provides node and required services.

Jump to

Keyboard shortcuts

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