Documentation ¶
Overview ¶
Package bertymessenger contains the top-level API that uses the Berty Protocol to implement the Berty Messenger specific logic.
Index ¶
- Constants
- func RestoreFromAccountExport(ctx context.Context, reader io.Reader, coreAPI ipfs_interface.CoreAPI, ...) error
- func TestingInfra(ctx context.Context, t *testing.T, amount int, logger *zap.Logger) ([]messengertypes.MessengerServiceClient, []*bertyprotocol.TestingProtocol, ...)
- func TestingService(ctx context.Context, t *testing.T, opts *TestingServiceOpts) (messengertypes.MessengerServiceServer, func())
- type ColumnInfo
- type Dispatcher
- func (d *Dispatcher) Notify(typ messengertypes.StreamEvent_Notified_Type, title, body string, ...) error
- func (d *Dispatcher) Register(n Notifiee) func()
- func (d *Dispatcher) StreamEvent(typ messengertypes.StreamEvent_Type, msg proto.Message, isNew bool) error
- func (d *Dispatcher) Unregister(n Notifiee)
- func (d *Dispatcher) UnregisterAll()
- type Notifiee
- type NotifieeBundle
- type Opts
- type Service
- type TestingAccount
- func (a *TestingAccount) Close()
- func (a *TestingAccount) DrainInitEvents(t *testing.T)
- func (a *TestingAccount) GetAccount() *messengertypes.Account
- func (a *TestingAccount) GetClient() messengertypes.MessengerServiceClient
- func (a *TestingAccount) GetContact(t *testing.T, pk string) *messengertypes.Contact
- func (a *TestingAccount) GetConversation(t *testing.T, pk string) *messengertypes.Conversation
- func (a *TestingAccount) GetMedia(t *testing.T, cid string) *messengertypes.Media
- func (a *TestingAccount) GetStream(t *testing.T) messengertypes.MessengerService_EventStreamClient
- func (a *TestingAccount) NextEvent(t *testing.T) *messengertypes.StreamEvent
- func (a *TestingAccount) ProcessWholeStream(t *testing.T) func()
- func (a *TestingAccount) SetName(t *testing.T, name string)
- func (a *TestingAccount) SetNameAndDrainUpdate(t *testing.T, name string)
- func (a *TestingAccount) TryNextEvent(t *testing.T, timeout time.Duration) *messengertypes.StreamEvent
- type TestingServiceOpts
Constants ¶
View Source
const ( StateActive lifecycle.State = iota StateInactive )
Variables ¶
This section is empty.
Functions ¶
func RestoreFromAccountExport ¶ added in v2.189.0
func RestoreFromAccountExport(ctx context.Context, reader io.Reader, coreAPI ipfs_interface.CoreAPI, odb *bertyprotocol.BertyOrbitDB, localDBState *messengertypes.LocalDatabaseState, logger *zap.Logger) error
func TestingInfra ¶ added in v2.172.0
func TestingInfra(ctx context.Context, t *testing.T, amount int, logger *zap.Logger) ([]messengertypes.MessengerServiceClient, []*bertyprotocol.TestingProtocol, func())
func TestingService ¶
func TestingService(ctx context.Context, t *testing.T, opts *TestingServiceOpts) (messengertypes.MessengerServiceServer, func())
Types ¶
type ColumnInfo ¶ added in v2.184.0
type ColumnInfo struct { ColumnID string Name string Type string NotNull *string DfltValue *string PK string }
func (*ColumnInfo) Equals ¶ added in v2.184.0
func (t *ColumnInfo) Equals(other *ColumnInfo) bool
type Dispatcher ¶ added in v2.120.0
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶ added in v2.120.0
func NewDispatcher() *Dispatcher
func (*Dispatcher) Notify ¶ added in v2.143.0
func (d *Dispatcher) Notify(typ messengertypes.StreamEvent_Notified_Type, title, body string, msg proto.Message) error
func (*Dispatcher) Register ¶ added in v2.120.0
func (d *Dispatcher) Register(n Notifiee) func()
func (*Dispatcher) StreamEvent ¶ added in v2.120.0
func (d *Dispatcher) StreamEvent(typ messengertypes.StreamEvent_Type, msg proto.Message, isNew bool) error
func (*Dispatcher) Unregister ¶ added in v2.120.0
func (d *Dispatcher) Unregister(n Notifiee)
func (*Dispatcher) UnregisterAll ¶ added in v2.143.0
func (d *Dispatcher) UnregisterAll()
type Notifiee ¶ added in v2.120.0
type Notifiee interface {
StreamEvent(*messengertypes.StreamEvent) error
}
Notifiee system inspired from ipfs
type NotifieeBundle ¶ added in v2.120.0
type NotifieeBundle struct {
StreamEventImpl func(c *messengertypes.StreamEvent) error
}
func (*NotifieeBundle) StreamEvent ¶ added in v2.120.0
func (nb *NotifieeBundle) StreamEvent(c *messengertypes.StreamEvent) error
type Opts ¶
type Opts struct { EnableGroupMonitor bool Logger *zap.Logger DB *gorm.DB NotificationManager notification.Manager LifeCycleManager *lifecycle.Manager StateBackup *messengertypes.LocalDatabaseState }
type Service ¶ added in v2.120.0
type Service interface { messengertypes.MessengerServiceServer Close() }
func New ¶
func New(client protocoltypes.ProtocolServiceClient, opts *Opts) (Service, error)
type TestingAccount ¶ added in v2.126.1
type TestingAccount struct {
// contains filtered or unexported fields
}
func NewTestingAccount ¶ added in v2.126.1
func NewTestingAccount(ctx context.Context, t *testing.T, client messengertypes.MessengerServiceClient, protocolClient protocoltypes.ProtocolServiceClient, logger *zap.Logger) *TestingAccount
func (*TestingAccount) Close ¶ added in v2.126.1
func (a *TestingAccount) Close()
func (*TestingAccount) DrainInitEvents ¶ added in v2.126.1
func (a *TestingAccount) DrainInitEvents(t *testing.T)
func (*TestingAccount) GetAccount ¶ added in v2.126.1
func (a *TestingAccount) GetAccount() *messengertypes.Account
func (*TestingAccount) GetClient ¶ added in v2.126.1
func (a *TestingAccount) GetClient() messengertypes.MessengerServiceClient
func (*TestingAccount) GetContact ¶ added in v2.228.1
func (a *TestingAccount) GetContact(t *testing.T, pk string) *messengertypes.Contact
func (*TestingAccount) GetConversation ¶ added in v2.218.0
func (a *TestingAccount) GetConversation(t *testing.T, pk string) *messengertypes.Conversation
func (*TestingAccount) GetMedia ¶ added in v2.228.1
func (a *TestingAccount) GetMedia(t *testing.T, cid string) *messengertypes.Media
func (*TestingAccount) GetStream ¶ added in v2.126.1
func (a *TestingAccount) GetStream(t *testing.T) messengertypes.MessengerService_EventStreamClient
func (*TestingAccount) NextEvent ¶ added in v2.126.1
func (a *TestingAccount) NextEvent(t *testing.T) *messengertypes.StreamEvent
func (*TestingAccount) ProcessWholeStream ¶ added in v2.218.0
func (a *TestingAccount) ProcessWholeStream(t *testing.T) func()
func (*TestingAccount) SetName ¶ added in v2.126.1
func (a *TestingAccount) SetName(t *testing.T, name string)
func (*TestingAccount) SetNameAndDrainUpdate ¶ added in v2.126.6
func (a *TestingAccount) SetNameAndDrainUpdate(t *testing.T, name string)
func (*TestingAccount) TryNextEvent ¶ added in v2.126.1
func (a *TestingAccount) TryNextEvent(t *testing.T, timeout time.Duration) *messengertypes.StreamEvent
type TestingServiceOpts ¶
type TestingServiceOpts struct { Logger *zap.Logger Client bertyprotocol.Client Index int }
Click to show internal directories.
Click to hide internal directories.