Documentation ¶
Index ¶
- type FeedRequester
- type IncomingMessage
- type IncomingStreamAdapter
- func (s IncomingStreamAdapter) IncomingMessages(ctx context.Context) <-chan IncomingMessage
- func (s IncomingStreamAdapter) RemoteIdentity() identity.Public
- func (s IncomingStreamAdapter) SendMessage(msg *message.Message) error
- func (s IncomingStreamAdapter) SendNotes(notes messages.EbtReplicateNotes) error
- type MessageStreamer
- type MessageWriter
- type OutgoingStreamAdapter
- func (r *OutgoingStreamAdapter) IncomingMessages(ctx context.Context) <-chan IncomingMessage
- func (r *OutgoingStreamAdapter) RemoteIdentity() identity.Public
- func (r *OutgoingStreamAdapter) SendMessage(msg *message.Message) error
- func (r *OutgoingStreamAdapter) SendNotes(notes messages.EbtReplicateNotes) error
- type Replicator
- type RequestedFeeds
- type Runner
- type SelfCreateHistoryStreamReplicator
- type SentNotes
- type Session
- type SessionEndedFn
- type SessionRunner
- type SessionTracker
- type Stream
- type StreamMessageWriter
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeedRequester ¶
type IncomingMessage ¶
type IncomingMessage struct {
// contains filtered or unexported fields
}
func NewIncomingMessageWithErr ¶
func NewIncomingMessageWithErr(err error) IncomingMessage
func NewIncomingMessageWithMessage ¶
func NewIncomingMessageWithMessage(msg message.RawMessage) IncomingMessage
func NewIncomingMessageWithNotes ¶
func NewIncomingMessageWithNotes(notes messages.EbtReplicateNotes) IncomingMessage
func (IncomingMessage) Err ¶
func (i IncomingMessage) Err() error
func (IncomingMessage) Msg ¶
func (i IncomingMessage) Msg() (message.RawMessage, bool)
func (IncomingMessage) Notes ¶
func (i IncomingMessage) Notes() (messages.EbtReplicateNotes, bool)
type IncomingStreamAdapter ¶
type IncomingStreamAdapter struct {
// contains filtered or unexported fields
}
func NewIncomingStreamAdapter ¶
func NewIncomingStreamAdapter(remoteIdentity identity.Public, stream mux.Stream) IncomingStreamAdapter
func (IncomingStreamAdapter) IncomingMessages ¶
func (s IncomingStreamAdapter) IncomingMessages(ctx context.Context) <-chan IncomingMessage
func (IncomingStreamAdapter) RemoteIdentity ¶
func (s IncomingStreamAdapter) RemoteIdentity() identity.Public
func (IncomingStreamAdapter) SendMessage ¶
func (s IncomingStreamAdapter) SendMessage(msg *message.Message) error
func (IncomingStreamAdapter) SendNotes ¶
func (s IncomingStreamAdapter) SendNotes(notes messages.EbtReplicateNotes) error
type MessageStreamer ¶
type MessageWriter ¶
type OutgoingStreamAdapter ¶
type OutgoingStreamAdapter struct {
// contains filtered or unexported fields
}
func NewOutgoingStreamAdapter ¶
func NewOutgoingStreamAdapter(remoteIdentity identity.Public, stream rpc.ResponseStream) *OutgoingStreamAdapter
func (*OutgoingStreamAdapter) IncomingMessages ¶
func (r *OutgoingStreamAdapter) IncomingMessages(ctx context.Context) <-chan IncomingMessage
func (*OutgoingStreamAdapter) RemoteIdentity ¶
func (r *OutgoingStreamAdapter) RemoteIdentity() identity.Public
func (*OutgoingStreamAdapter) SendMessage ¶
func (r *OutgoingStreamAdapter) SendMessage(msg *message.Message) error
func (*OutgoingStreamAdapter) SendNotes ¶
func (r *OutgoingStreamAdapter) SendNotes(notes messages.EbtReplicateNotes) error
type Replicator ¶
type Replicator struct {
// contains filtered or unexported fields
}
func NewReplicator ¶
func NewReplicator( tracker Tracker, runner Runner, selfCreateHistoryStreamReplicator SelfCreateHistoryStreamReplicator, logger logging.Logger, ) Replicator
func (Replicator) HandleIncoming ¶
func (r Replicator) HandleIncoming(ctx context.Context, version int, format messages.EbtReplicateFormat, stream Stream) error
type RequestedFeeds ¶
type RequestedFeeds struct {
// contains filtered or unexported fields
}
func NewRequestedFeeds ¶
func NewRequestedFeeds(messageStreamer MessageStreamer, stream Stream) *RequestedFeeds
func (*RequestedFeeds) Cancel ¶
func (r *RequestedFeeds) Cancel(ref refs.Feed)
type SentNotes ¶
type SentNotes struct {
// contains filtered or unexported fields
}
func NewSentNotes ¶
func NewSentNotes() *SentNotes
func (*SentNotes) Update ¶
func (w *SentNotes) Update(contacts []replication.Contact) (messages.EbtReplicateNotes, error)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession( ctx context.Context, stream Stream, logger logging.Logger, rawMessageHandler replication.RawMessageHandler, contactsStorage replication.ContactsStorage, feedRequester FeedRequester, ) *Session
func (*Session) HandleIncomingMessagesLoop ¶
func (*Session) SendNotesLoop ¶
func (s *Session) SendNotesLoop()
type SessionEndedFn ¶
type SessionEndedFn func()
type SessionRunner ¶
type SessionRunner struct {
// contains filtered or unexported fields
}
func NewSessionRunner ¶
func NewSessionRunner( logger logging.Logger, rawMessageHandler replication.RawMessageHandler, contactsStorage replication.ContactsStorage, streamer MessageStreamer, ) *SessionRunner
func (*SessionRunner) HandleStream ¶
func (s *SessionRunner) HandleStream(ctx context.Context, stream Stream) error
type SessionTracker ¶
type SessionTracker struct {
// contains filtered or unexported fields
}
func NewSessionTracker ¶
func NewSessionTracker() *SessionTracker
func (*SessionTracker) OpenSession ¶
func (t *SessionTracker) OpenSession(id rpc.ConnectionId) (SessionEndedFn, error)
func (*SessionTracker) SomeoneIsWaiting ¶
func (t *SessionTracker) SomeoneIsWaiting(id rpc.ConnectionId) bool
func (*SessionTracker) WaitForSession ¶
func (t *SessionTracker) WaitForSession(ctx context.Context, id rpc.ConnectionId, waitTime time.Duration) (bool, error)
type StreamMessageWriter ¶
type StreamMessageWriter struct {
// contains filtered or unexported fields
}
func NewStreamMessageWriter ¶
func NewStreamMessageWriter(stream Stream) *StreamMessageWriter
func (StreamMessageWriter) WriteMessage ¶
func (s StreamMessageWriter) WriteMessage(msg message.Message) error
type Tracker ¶
type Tracker interface { OpenSession(id rpc.ConnectionId) (SessionEndedFn, error) // WaitForSession waits for the session to be started for the provided // amount of time. If the session starts within the provided time window // then WaitForSession blocks for as long as the session is running. // Returning true signifies that the session existed at any point after // calling this function. Error is returned if the context is cancelled. WaitForSession(ctx context.Context, id rpc.ConnectionId, waitTime time.Duration) (bool, error) }
Click to show internal directories.
Click to hide internal directories.