Commit ca0f1085 authored by David Stainton's avatar David Stainton

Use locally defined message consumer interface

parent 3e46811c
......@@ -26,6 +26,13 @@ import (
"github.com/op/go-logging"
)
// MessageConsumer is an interface used for
// processing received messages
type MessageConsumer interface {
ReceivedMessage(senderPubKey *ecdh.PublicKey, message []byte)
ReceivedACK(messageID *[block.MessageIDLength]byte, message []byte)
}
// StorageStub implements the Storage interface
// as defined in the client library.
// XXX This should be replaced by something useful.
......@@ -81,7 +88,7 @@ func (s *Session) Get(identity string) (*ecdh.PublicKey, error) {
}
// Connect connects the client to the Provider
func (s *Session) Connect(identityPrivKey *Key, messageConsumer client.MessageConsumer) error {
func (s *Session) Connect(identityPrivKey *Key, messageConsumer MessageConsumer) error {
sessionCfg := client.SessionConfig{
User: s.clientCfg.User,
Provider: s.clientCfg.Provider,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment