...

Package storage

import "vminko.org/dscuss/storage"
Overview
Index

Overview ▾

type Storage

Storage is a mediator between Owner and Peers. It provides subscriptions to new entities and functions for managing entities.

type Storage struct {
    // contains filtered or unexported fields
}

func New

func New(db *sqlite.EntityDatabase) *Storage

func (*Storage) AttachObserver

func (s *Storage) AttachObserver(c chan<- entity.Entity)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) DetachObserver

func (s *Storage) DetachObserver(c chan<- entity.Entity)

func (*Storage) GetEntity

func (s *Storage) GetEntity(eid *entity.ID) (entity.Entity, error)

func (*Storage) GetMessage

func (s *Storage) GetMessage(eid *entity.ID) (*entity.Message, error)

func (*Storage) GetOperation

func (s *Storage) GetOperation(oid *entity.ID) (*entity.Operation, error)

func (*Storage) GetOperationsOnMessage

func (s *Storage) GetOperationsOnMessage(mid *entity.ID) ([]*entity.Operation, error)

func (*Storage) GetOperationsOnUser

func (s *Storage) GetOperationsOnUser(uid *entity.ID) ([]*entity.Operation, error)

func (*Storage) GetRoot

func (s *Storage) GetRoot(m *entity.Message) (*entity.Message, error)

func (*Storage) GetRootMessages

func (s *Storage) GetRootMessages(offset, limit int) ([]*entity.Message, error)

func (*Storage) GetThread

func (s *Storage) GetThread(root *entity.ID) (*thread.Node, error)

func (*Storage) GetTopicMessages

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 (*Storage) HasEntity

func (s *Storage) HasEntity(eid *entity.ID) (bool, error)

func (*Storage) HasMessage

func (s *Storage) HasMessage(id *entity.ID) (bool, error)

func (*Storage) HasUser

func (s *Storage) HasUser(id *entity.ID) (bool, error)

func (*Storage) PutEntity

func (s *Storage) PutEntity(ent entity.Entity, sender chan<- entity.Entity) error