statusproto

package module
v0.1.0 Latest Latest
Warning

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

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

README

status-protocol-go

This is the Status Protocol implementation in Go.

TBD

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChatIDEmpty    = errors.New("chat ID is empty")
	ErrNotImplemented = errors.New("not implemented")
)
View Source
var (
	RetrieveLatest  = RetrieveConfig{/* contains filtered or unexported fields */}
	RetrieveLastDay = RetrieveConfig{/* contains filtered or unexported fields */}
)
View Source
var (
	// ErrMsgAlreadyExist returned if msg already exist.
	ErrMsgAlreadyExist = errors.New("message with given ID already exist")
)

Functions

func WithCustomLogger

func WithCustomLogger(logger *zap.Logger) func(c *config) error

func WithDatabaseFilePaths added in v0.1.0

func WithDatabaseFilePaths(encryptionLayerFilePath, transportLayerFilePath string) func(c *config) error

TODO: use this config fileds.

func WithGenericDiscoveryTopicSupport

func WithGenericDiscoveryTopicSupport() func(c *config) error

func WithMessagesPersistenceEnabled

func WithMessagesPersistenceEnabled() func(c *config) error

func WithOnNewInstallationsHandler

func WithOnNewInstallationsHandler(h func([]*multidevice.Installation)) func(c *config) error

func WithOnNewSharedSecret

func WithOnNewSharedSecret(h func([]*sharedsecret.Secret)) func(c *config) error

func WithSendV1Messages

func WithSendV1Messages() func(c *config) error

Types

type Chat

type Chat interface {
	ID() string
	PublicName() string
	PublicKey() *ecdsa.PublicKey
}

type Messenger

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

Messenger is a entity managing chats and messages. It acts as a bridge between the application and encryption layers. It needs to expose an interface to manage installations because installations are managed by the user. Similarly, it needs to expose an interface to manage mailservers because they can also be managed by the user.

func NewMessenger

func NewMessenger(
	identity *ecdsa.PrivateKey,
	server transport.Server,
	shh *whisper.Whisper,
	dataDir string,
	dbKey string,
	installationID string,
	opts ...Option,
) (*Messenger, error)

func (*Messenger) AddMailserver

func (m *Messenger) AddMailserver(enode string) error

NOT IMPLEMENTED

func (*Messenger) ConfirmMessagesProcessed

func (m *Messenger) ConfirmMessagesProcessed(messageIDs [][]byte) error

DEPRECATED

func (*Messenger) DisableInstallation

func (m *Messenger) DisableInstallation(id string) error

func (*Messenger) EnableInstallation

func (m *Messenger) EnableInstallation(id string) error

func (*Messenger) Installations

func (m *Messenger) Installations() ([]*multidevice.Installation, error)

func (*Messenger) Join

func (m *Messenger) Join(chat Chat) error

func (*Messenger) Leave

func (m *Messenger) Leave(chat Chat) error

func (*Messenger) LoadFilters

func (m *Messenger) LoadFilters(chats []*filter.Chat) ([]*filter.Chat, error)

DEPRECATED

func (*Messenger) Mailservers

func (m *Messenger) Mailservers() ([]string, error)

NOT IMPLEMENTED

func (*Messenger) RemoveFilters

func (m *Messenger) RemoveFilters(chats []*filter.Chat) error

DEPRECATED

func (*Messenger) RemoveMailserver

func (m *Messenger) RemoveMailserver(id string) error

NOT IMPLEMENTED

func (*Messenger) Retrieve

func (m *Messenger) Retrieve(ctx context.Context, chat Chat, c RetrieveConfig) (messages []*protocol.Message, err error)

func (*Messenger) RetrieveRawAll

func (m *Messenger) RetrieveRawAll() (map[filter.Chat][]*whisper.Message, error)

DEPRECATED

func (*Messenger) RetrieveRawWithFilter added in v0.1.0

func (m *Messenger) RetrieveRawWithFilter(filterID string) ([]*whisper.Message, error)

DEPRECATED

func (*Messenger) SelectMailserver

func (m *Messenger) SelectMailserver(id string) error

NOT IMPLEMENTED

func (*Messenger) Send

func (m *Messenger) Send(ctx context.Context, chat Chat, data []byte) ([]byte, error)

func (*Messenger) SendRaw

func (m *Messenger) SendRaw(ctx context.Context, chat Chat, data []byte) ([]byte, whisper.NewMessage, error)

SendRaw takes encoded data, encrypts it and sends through the wire. DEPRECATED

func (*Messenger) SetInstallationMetadata

func (m *Messenger) SetInstallationMetadata(id string, data *multidevice.InstallationMetadata) error

func (*Messenger) Shutdown

func (m *Messenger) Shutdown() (err error)

Shutdown takes care of ensuring a clean shutdown of Messenger

type Option

type Option func(*config) error

type RetrieveConfig

type RetrieveConfig struct {
	From time.Time
	To   time.Time
	// contains filtered or unexported fields
}

Directories

Path Synopsis
bridge
geth Module
internal
Package sqlite is responsible for creation of encrypted sqlite3 database using sqlcipher driver.
Package sqlite is responsible for creation of encrypted sqlite3 database using sqlcipher driver.
transport

Jump to

Keyboard shortcuts

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