Documentation ¶
Overview ¶
Package bertymessenger contains the top-level API that uses the Berty Protocol to implement the Berty Messenger specific logic.
Index ¶
- Constants
- func PushSealTokenForServer(receiver *pushtypes.PushServiceReceiver, server *messengertypes.PushServer) (*messengertypes.PushMemberTokenUpdate, error)
- func RestoreFromAccountExport(ctx context.Context, reader io.Reader, coreAPI ipfs_interface.CoreAPI, ...) error
- type Dispatcher
- func (d *Dispatcher) IsEnabled() bool
- 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 MetaFetcherFromProtocolClient
- type Notifiee
- type NotifieeBundle
- type Opts
- type RecvEvent
- type Service
- type ServiceClient
- func NewClientFromService(ctx context.Context, s *grpc.Server, svc Service, opts ...grpc.DialOption) (ServiceClient, error)
- func NewServiceClient(wesh protocoltypes.ProtocolServiceClient, opts *Opts) (ServiceClient, error)
- func TestingClientFromServer(ctx context.Context, t testing.TB, s *grpc.Server, svc Service, ...) (client ServiceClient, cleanup func())
- type TestingAccount
- func (a *TestingAccount) Close()
- func (a *TestingAccount) DrainInitEvents(t testing.TB)
- func (a *TestingAccount) GetAccount() *messengertypes.Account
- func (a *TestingAccount) GetAllContacts() map[string]*messengertypes.Contact
- func (a *TestingAccount) GetAllConversations() map[string]*messengertypes.Conversation
- func (a *TestingAccount) GetClient() messengertypes.MessengerServiceClient
- func (a *TestingAccount) GetContact(t testing.TB, pk string) *messengertypes.Contact
- func (a *TestingAccount) GetConversation(t testing.TB, pk string) *messengertypes.Conversation
- func (a *TestingAccount) GetInteraction(t testing.TB, cid string) *messengertypes.Interaction
- func (a *TestingAccount) GetMember(t testing.TB, pk string) *messengertypes.Member
- func (a *TestingAccount) GetStream(t testing.TB) <-chan *RecvEvent
- func (a *TestingAccount) NextEvent(t testing.TB) *messengertypes.StreamEvent
- func (a *TestingAccount) ProcessWholeStream(t testing.TB) func()
- func (a *TestingAccount) SetName(t testing.TB, name string)
- func (a *TestingAccount) SetNameAndDrainUpdate(t testing.TB, name string)
- func (a *TestingAccount) TryNextEvent(t testing.TB, timeout time.Duration) *messengertypes.StreamEvent
- type TestingService
- type TestingServiceOpts
Constants ¶
View Source
const ClientBufferSize = 4 * 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func PushSealTokenForServer ¶ added in v2.470.0
func PushSealTokenForServer(receiver *pushtypes.PushServiceReceiver, server *messengertypes.PushServer) (*messengertypes.PushMemberTokenUpdate, error)
PushSealTokenForServer seals a device push token with the push server public key
func RestoreFromAccountExport ¶ added in v2.189.0
func RestoreFromAccountExport(ctx context.Context, reader io.Reader, coreAPI ipfs_interface.CoreAPI, odb *weshnet.WeshOrbitDB, localDBState *mt.LocalDatabaseState, logger *zap.Logger) error
Types ¶
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) IsEnabled ¶ added in v2.308.0
func (d *Dispatcher) IsEnabled() bool
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 MetaFetcherFromProtocolClient ¶ added in v2.308.0
type MetaFetcherFromProtocolClient struct {
// contains filtered or unexported fields
}
func (*MetaFetcherFromProtocolClient) GroupPKForContact ¶ added in v2.308.0
func (*MetaFetcherFromProtocolClient) OwnMemberAndDevicePKForConversation ¶ added in v2.308.0
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 *mt.LocalDatabaseState PushKey *[cryptoutil.KeySize]byte PlatformPushToken *pushtypes.PushServiceReceiver Ring *zapring.Core GRPCInsecureMode bool // LogFilePath defines the location of the current session's log file. // // This variable is used by svc.TyberHostAttach. LogFilePath string }
type RecvEvent ¶ added in v2.291.0
type RecvEvent struct {
// contains filtered or unexported fields
}
type Service ¶ added in v2.120.0
type Service interface { mt.MessengerServiceServer Close() }
func New ¶
func New(client protocoltypes.ProtocolServiceClient, opts *Opts) (_ Service, err error)
type ServiceClient ¶ added in v2.470.0
type ServiceClient interface { messengertypes.MessengerServiceClient io.Closer }
func NewClientFromService ¶ added in v2.470.0
func NewClientFromService(ctx context.Context, s *grpc.Server, svc Service, opts ...grpc.DialOption) (ServiceClient, error)
func NewServiceClient ¶ added in v2.470.0
func NewServiceClient(wesh protocoltypes.ProtocolServiceClient, opts *Opts) (ServiceClient, error)
func TestingClientFromServer ¶ added in v2.470.0
func TestingClientFromServer(ctx context.Context, t testing.TB, s *grpc.Server, svc Service, dialOpts ...grpc.DialOption) (client ServiceClient, cleanup func())
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.TB, client messengertypes.MessengerServiceClient, protocolClient protocoltypes.ProtocolServiceClient, logger *zap.Logger) *TestingAccount
func Testing1To1ProcessWholeStream ¶ added in v2.266.0
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.TB)
func (*TestingAccount) GetAccount ¶ added in v2.126.1
func (a *TestingAccount) GetAccount() *messengertypes.Account
func (*TestingAccount) GetAllContacts ¶ added in v2.250.0
func (a *TestingAccount) GetAllContacts() map[string]*messengertypes.Contact
func (*TestingAccount) GetAllConversations ¶ added in v2.250.0
func (a *TestingAccount) GetAllConversations() map[string]*messengertypes.Conversation
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.TB, pk string) *messengertypes.Contact
func (*TestingAccount) GetConversation ¶ added in v2.218.0
func (a *TestingAccount) GetConversation(t testing.TB, pk string) *messengertypes.Conversation
func (*TestingAccount) GetInteraction ¶ added in v2.266.0
func (a *TestingAccount) GetInteraction(t testing.TB, cid string) *messengertypes.Interaction
func (*TestingAccount) GetMember ¶ added in v2.291.0
func (a *TestingAccount) GetMember(t testing.TB, pk string) *messengertypes.Member
func (*TestingAccount) GetStream ¶ added in v2.126.1
func (a *TestingAccount) GetStream(t testing.TB) <-chan *RecvEvent
func (*TestingAccount) NextEvent ¶ added in v2.126.1
func (a *TestingAccount) NextEvent(t testing.TB) *messengertypes.StreamEvent
func (*TestingAccount) ProcessWholeStream ¶ added in v2.218.0
func (a *TestingAccount) ProcessWholeStream(t testing.TB) func()
func (*TestingAccount) SetName ¶ added in v2.126.1
func (a *TestingAccount) SetName(t testing.TB, name string)
func (*TestingAccount) SetNameAndDrainUpdate ¶ added in v2.126.6
func (a *TestingAccount) SetNameAndDrainUpdate(t testing.TB, name string)
func (*TestingAccount) TryNextEvent ¶ added in v2.126.1
func (a *TestingAccount) TryNextEvent(t testing.TB, timeout time.Duration) *messengertypes.StreamEvent
type TestingService ¶
type TestingService struct { Logger *zap.Logger Service Service Client ServiceClient }
func NewTestingService ¶ added in v2.470.0
func NewTestingService(ctx context.Context, t testing.TB, opts *TestingServiceOpts) (*TestingService, func())
func TestingInfra ¶ added in v2.172.0
func TestingInfra(ctx context.Context, t testing.TB, amount int, logger *zap.Logger) ([]*TestingService, []*weshnet.TestingProtocol, func())
Source Files ¶
Click to show internal directories.
Click to hide internal directories.