Package storage
    
  
	
	
		
		
		
		
		
		
			
		
		
			
		
			
			
			
			
			
			
				
				- type Storage
-     func New(db *sqlite.EntityDatabase) *Storage
-     func (s *Storage) AttachObserver(c chan<- entity.Entity)
-     func (s *Storage) Close() error
-     func (s *Storage) DetachObserver(c chan<- entity.Entity)
-     func (s *Storage) GetEntity(eid *entity.ID) (entity.Entity, error)
-     func (s *Storage) GetMessage(eid *entity.ID) (*entity.Message, error)
-     func (s *Storage) GetMessageDepth(m *entity.Message) (int, error)
-     func (s *Storage) GetMessagesStoredAfter(ts time.Time, limit int) ([]*entity.StoredMessage, error)
-     func (s *Storage) GetNearMessageID(m *entity.Message, diff time.Duration) (*entity.ID, error)
-     func (s *Storage) GetOperation(oid *entity.ID) (*entity.Operation, error)
-     func (s *Storage) GetOperationsOnMessage(mid *entity.ID) ([]*entity.Operation, error)
-     func (s *Storage) GetOperationsOnUser(uid *entity.ID) ([]*entity.Operation, error)
-     func (s *Storage) GetOperationsStoredAfter(ts time.Time, limit int) ([]*entity.StoredOperation, error)
-     func (s *Storage) GetRoot(m *entity.Message) (*entity.Message, error)
-     func (s *Storage) GetRootMessages(offset, limit int) ([]*entity.Message, error)
-     func (s *Storage) GetThread(root *entity.ID) (*thread.Node, error)
-     func (s *Storage) GetTopicMessages(topic subs.Topic, offset, limit int) ([]*entity.Message, error)
-     func (s *Storage) GetUser(eid *entity.ID) (*entity.User, error)
-     func (s *Storage) HasEntity(eid *entity.ID) (bool, error)
-     func (s *Storage) HasMessage(id *entity.ID) (bool, error)
-     func (s *Storage) HasUser(id *entity.ID) (bool, error)
-     func (s *Storage) PutEntity(ent entity.Entity, sender chan<- entity.Entity) error
 
		
		
			Package files
			
			
			
				storage.go
			
			
			
		
		 
		 
		
		
			
		
 
		
			
			
			  In the call graph viewer below, each node
			  is a function belonging to this package
			  and its children are the functions it
			  calls—perhaps dynamically.
			
			
			  The root nodes are the entry points of the
			  package: functions that may be called from
			  outside the package.
			  There may be non-exported or anonymous
			  functions among them if they are called
			  dynamically from another package.
			
			
			  Click a node to visit that function's source code.
			  From there you can visit its callers by
			  clicking its declaring func
			  token.
			
			
			  Functions may be omitted if they were
			  determined to be unreachable in the
			  particular programs or tests that were
			  analyzed.
			
			
			
		 
		  
		
		
		
		
			
			
			
			
Storage is a mediator between Owner and Peers. It provides subscriptions to
new entities and functions for managing entities.
			type Storage struct {
    
}
			
			
			
			
			
			
				
				
				func New(db *sqlite.EntityDatabase) *Storage
				
				
				
			
			
				
				
				func (s *Storage) AttachObserver(c chan<- entity.Entity)
				
				
				
				
			
				
				func (*Storage) Close
					¶
					
					
				
				func (s *Storage) Close() error
				
				
				
				
			
				
				
				func (s *Storage) DetachObserver(c chan<- entity.Entity)
				
				
				
				
			
				
				
				func (s *Storage) GetEntity(eid *entity.ID) (entity.Entity, error)
				
				
				
				
			
				
				
				func (s *Storage) GetMessage(eid *entity.ID) (*entity.Message, error)
				
				
				
				
			
				
				
				func (s *Storage) GetMessageDepth(m *entity.Message) (int, error)
				
				
				
				
			
				
				
				func (s *Storage) GetMessagesStoredAfter(ts time.Time, limit int) ([]*entity.StoredMessage, error)
				
				
				
				
			
				
				
				func (s *Storage) GetNearMessageID(m *entity.Message, diff time.Duration) (*entity.ID, error)
				
				
				
				
			
				
				
				func (s *Storage) GetOperation(oid *entity.ID) (*entity.Operation, error)
				
				
				
				
			
				
				
				func (s *Storage) GetOperationsOnMessage(mid *entity.ID) ([]*entity.Operation, error)
				
				
				
				
			
				
				
				func (s *Storage) GetOperationsOnUser(uid *entity.ID) ([]*entity.Operation, error)
				
				
				
				
			
				
				
				func (s *Storage) GetOperationsStoredAfter(ts time.Time, limit int) ([]*entity.StoredOperation, error)
				
				
				
				
			
				
				func (*Storage) GetRoot
					¶
					
					
				
				func (s *Storage) GetRoot(m *entity.Message) (*entity.Message, error)
				
				
				
				
			
				
				
				func (s *Storage) GetRootMessages(offset, limit int) ([]*entity.Message, error)
				
				
				
				
			
				
				
				func (s *Storage) GetThread(root *entity.ID) (*thread.Node, error)
				
				
				
				
			
				
				
				func (s *Storage) GetTopicMessages(topic subs.Topic, offset, limit int) ([]*entity.Message, error)
				
				
				
				
			
				
				func (*Storage) GetUser
					¶
					
					
				
				func (s *Storage) GetUser(eid *entity.ID) (*entity.User, error)
				
				
				
				
			
				
				
				func (s *Storage) HasEntity(eid *entity.ID) (bool, error)
				
				
				
				
			
				
				
				func (s *Storage) HasMessage(id *entity.ID) (bool, error)
				
				
				
				
			
				
				func (*Storage) HasUser
					¶
					
					
				
				func (s *Storage) HasUser(id *entity.ID) (bool, error)
				
				
				
				
			
				
				
				func (s *Storage) PutEntity(ent entity.Entity, sender chan<- entity.Entity) error