publisher

package
v0.27.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrPFSNotEnabled is returned when an endpoint PFS only is called but
	// PFS is disabled
	ErrPFSNotEnabled = errors.New("pfs not enabled")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	PfsEnabled     bool
	DataDir        string
	InstallationID string
}

type Persistence

type Persistence interface {
	Get() (int64, error)
	Set(int64) error
}

type SQLLitePersistence

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

func NewSQLLitePersistence

func NewSQLLitePersistence(db *sql.DB) *SQLLitePersistence

func (*SQLLitePersistence) Get

func (s *SQLLitePersistence) Get() (int64, error)

func (*SQLLitePersistence) Set

func (s *SQLLitePersistence) Set(lastPublished int64) error

type Service

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

func New

func New(config *Config, w *whisper.Whisper) *Service

func (*Service) ConfirmMessagesProcessed

func (s *Service) ConfirmMessagesProcessed(ids [][]byte) error

func (*Service) CreateDirectMessage

func (s *Service) CreateDirectMessage(signature string, destination hexutil.Bytes, DH bool, payload []byte) (*whisper.NewMessage, error)

CreateDirectMessage creates a 1:1 chat message

func (*Service) CreatePublicMessage

func (s *Service) CreatePublicMessage(signature string, chatID string, payload []byte, wrap bool) (*whisper.NewMessage, error)

CreatePublicMessage sends a public chat message to the underlying transport

func (*Service) DisableInstallation

func (s *Service) DisableInstallation(myIdentityKey *ecdsa.PublicKey, installationID string) error

DisableInstallation disables an installation for multi-device sync.

func (*Service) EnableInstallation

func (s *Service) EnableInstallation(myIdentityKey *ecdsa.PublicKey, installationID string) error

EnableInstallation enables an installation for multi-device sync.

func (*Service) GetBundle

func (s *Service) GetBundle(myIdentityKey *ecdsa.PrivateKey) (*protobuf.Bundle, error)

func (*Service) GetPublicBundle

func (s *Service) GetPublicBundle(identityKey *ecdsa.PublicKey) (*protobuf.Bundle, error)

func (*Service) InitProtocolWithEncyptionKey

func (s *Service) InitProtocolWithEncyptionKey(address string, encKey string) error

InitProtocolWithEncyptionKey creates an instance of ProtocolService given an address and encryption key.

func (*Service) InitProtocolWithPassword

func (s *Service) InitProtocolWithPassword(address string, password string) error

InitProtocolWithPassword creates an instance of ProtocolService given an address and password used to generate an encryption key.

func (*Service) LoadFilter

func (s *Service) LoadFilter(chat *filter.Chat) ([]*filter.Chat, error)

func (*Service) LoadFilters

func (s *Service) LoadFilters(chats []*filter.Chat) ([]*filter.Chat, error)

func (*Service) ProcessMessage

func (s *Service) ProcessMessage(dedupMessage dedup.DeduplicateMessage) error

func (*Service) ProcessPublicBundle

func (s *Service) ProcessPublicBundle(myIdentityKey *ecdsa.PrivateKey, bundle *protobuf.Bundle) ([]*multidevice.IdentityAndID, error)

func (*Service) RemoveFilters

func (s *Service) RemoveFilters(chats []*filter.Chat) error

func (*Service) Start

func (s *Service) Start(online func() bool, startTicker bool) error

func (*Service) Stop

func (s *Service) Stop() error

type SignalHandler

type SignalHandler struct{}

SignalHandler sends signals on protocol events

func (SignalHandler) BundleAdded

func (h SignalHandler) BundleAdded(identity string, installationID string)

func (SignalHandler) DecryptMessageFailed

func (h SignalHandler) DecryptMessageFailed(pubKey string)

func (SignalHandler) WhisperFilterAdded

func (h SignalHandler) WhisperFilterAdded(filters []*signal.Filter)

Jump to

Keyboard shortcuts

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