...

Package sqlite

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

Overview ▾

Index ▾

type EntityDatabase
    func OpenEntityDatabase(fileName string) (*EntityDatabase, error)
    func (d *EntityDatabase) Close() error
    func (d *EntityDatabase) GetMessage(eid *entity.ID) (*entity.Message, error)
    func (d *EntityDatabase) GetOperation(oid *entity.ID) (*entity.Operation, error)
    func (d *EntityDatabase) GetOperationsOnMessage(mid *entity.ID) ([]*entity.Operation, error)
    func (d *EntityDatabase) GetOperationsOnUser(uid *entity.ID) ([]*entity.Operation, error)
    func (d *EntityDatabase) GetReplies(eid *entity.ID) ([]*entity.Message, error)
    func (d *EntityDatabase) GetRootMessages(offset, limit int) ([]*entity.Message, error)
    func (d *EntityDatabase) GetThread(eid *entity.ID) (*thread.Node, error)
    func (d *EntityDatabase) GetTopicMessages(topic subs.Topic, offset, limit int) ([]*entity.Message, error)
    func (d *EntityDatabase) GetUser(eid *entity.ID) (*entity.User, error)
    func (d *EntityDatabase) HasMessage(eid *entity.ID) (bool, error)
    func (d *EntityDatabase) HasOperation(eid *entity.ID) (bool, error)
    func (d *EntityDatabase) HasUser(eid *entity.ID) (bool, error)
    func (d *EntityDatabase) PutMessage(msg *entity.Message) error
    func (d *EntityDatabase) PutOperation(oper *entity.Operation) error
    func (d *EntityDatabase) PutUser(user *entity.User) error
type ProfileDatabase
    func OpenProfileDatabase(fileName string) (*ProfileDatabase, error)
    func (s *ProfileDatabase) Close() error
    func (s *ProfileDatabase) GetModerators() ([]*entity.ID, error)
    func (s *ProfileDatabase) GetSubscriptions() (subs.Subscriptions, error)
    func (s *ProfileDatabase) PutModerator(id *entity.ID) error
    func (s *ProfileDatabase) PutSubscription(t subs.Topic) error
    func (s *ProfileDatabase) RemoveModerator(id *entity.ID) error
    func (s *ProfileDatabase) RemoveSubscription(t subs.Topic) error

Package files

entity_database.go profile_database.go

type EntityDatabase

EntityDatabase stores Entities.

type EntityDatabase sql.DB

func OpenEntityDatabase

func OpenEntityDatabase(fileName string) (*EntityDatabase, error)

func (*EntityDatabase) Close

func (d *EntityDatabase) Close() error

func (*EntityDatabase) GetMessage

func (d *EntityDatabase) GetMessage(eid *entity.ID) (*entity.Message, error)

func (*EntityDatabase) GetOperation

func (d *EntityDatabase) GetOperation(oid *entity.ID) (*entity.Operation, error)

func (*EntityDatabase) GetOperationsOnMessage

func (d *EntityDatabase) GetOperationsOnMessage(mid *entity.ID) ([]*entity.Operation, error)

func (*EntityDatabase) GetOperationsOnUser

func (d *EntityDatabase) GetOperationsOnUser(uid *entity.ID) ([]*entity.Operation, error)

func (*EntityDatabase) GetReplies

func (d *EntityDatabase) GetReplies(eid *entity.ID) ([]*entity.Message, error)

func (*EntityDatabase) GetRootMessages

func (d *EntityDatabase) GetRootMessages(offset, limit int) ([]*entity.Message, error)

func (*EntityDatabase) GetThread

func (d *EntityDatabase) GetThread(eid *entity.ID) (*thread.Node, error)

func (*EntityDatabase) GetTopicMessages

func (d *EntityDatabase) GetTopicMessages(topic subs.Topic, offset, limit int) ([]*entity.Message, error)

func (*EntityDatabase) GetUser

func (d *EntityDatabase) GetUser(eid *entity.ID) (*entity.User, error)

func (*EntityDatabase) HasMessage

func (d *EntityDatabase) HasMessage(eid *entity.ID) (bool, error)

func (*EntityDatabase) HasOperation

func (d *EntityDatabase) HasOperation(eid *entity.ID) (bool, error)

func (*EntityDatabase) HasUser

func (d *EntityDatabase) HasUser(eid *entity.ID) (bool, error)

func (*EntityDatabase) PutMessage

func (d *EntityDatabase) PutMessage(msg *entity.Message) error

func (*EntityDatabase) PutOperation

func (d *EntityDatabase) PutOperation(oper *entity.Operation) error

func (*EntityDatabase) PutUser

func (d *EntityDatabase) PutUser(user *entity.User) error

type ProfileDatabase

ProfileDatabase stores personal settings of the owner. It includes owner's subscriptions, list of chosen moderators. flags that message has been read (TBD) and so on.

type ProfileDatabase sql.DB

func OpenProfileDatabase

func OpenProfileDatabase(fileName string) (*ProfileDatabase, error)

func (*ProfileDatabase) Close

func (s *ProfileDatabase) Close() error

func (*ProfileDatabase) GetModerators

func (s *ProfileDatabase) GetModerators() ([]*entity.ID, error)

func (*ProfileDatabase) GetSubscriptions

func (s *ProfileDatabase) GetSubscriptions() (subs.Subscriptions, error)

func (*ProfileDatabase) PutModerator

func (s *ProfileDatabase) PutModerator(id *entity.ID) error

func (*ProfileDatabase) PutSubscription

func (s *ProfileDatabase) PutSubscription(t subs.Topic) error

func (*ProfileDatabase) RemoveModerator

func (s *ProfileDatabase) RemoveModerator(id *entity.ID) error

func (*ProfileDatabase) RemoveSubscription

func (s *ProfileDatabase) RemoveSubscription(t subs.Topic) error