...

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) GetMessagesStoredAfter(ts time.Time, limit int) ([]*entity.StoredMessage, error)
    func (d *EntityDatabase) GetNearMessageID(m *entity.Message, diff time.Duration) (*entity.ID, 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) GetOperationsStoredAfter(ts time.Time, limit int) ([]*entity.StoredOperation, 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, ts time.Time) error
    func (d *EntityDatabase) PutOperation(oper *entity.Operation, ts time.Time) error
    func (d *EntityDatabase) PutUser(user *entity.User, ts time.Time) error
type ProfileDatabase
    func OpenProfileDatabase(fileName string) (*ProfileDatabase, error)
    func (pd *ProfileDatabase) Close() error
    func (pd *ProfileDatabase) GetFullHistory() ([]*entity.UserHistory, error)
    func (pd *ProfileDatabase) GetModerators() ([]*entity.ID, error)
    func (pd *ProfileDatabase) GetSubscriptions() (subs.Subscriptions, error)
    func (pd *ProfileDatabase) GetUserHistory(id *entity.ID) (*entity.UserHistory, error)
    func (pd *ProfileDatabase) PutModerator(id *entity.ID) error
    func (pd *ProfileDatabase) PutSubscription(t subs.Topic) error
    func (pd *ProfileDatabase) PutUserHistory(h *entity.UserHistory) error
    func (pd *ProfileDatabase) RemoveModerator(id *entity.ID) error
    func (pd *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) GetMessagesStoredAfter

func (d *EntityDatabase) GetMessagesStoredAfter(ts time.Time, limit int) ([]*entity.StoredMessage, error)

func (*EntityDatabase) GetNearMessageID

func (d *EntityDatabase) GetNearMessageID(
    m *entity.Message,
    diff time.Duration,
) (*entity.ID, 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) GetOperationsStoredAfter

func (d *EntityDatabase) GetOperationsStoredAfter(ts time.Time, limit int) ([]*entity.StoredOperation, 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, ts time.Time) error

func (*EntityDatabase) PutOperation

func (d *EntityDatabase) PutOperation(oper *entity.Operation, ts time.Time) error

func (*EntityDatabase) PutUser

func (d *EntityDatabase) PutUser(user *entity.User, ts time.Time) 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 (pd *ProfileDatabase) Close() error

func (*ProfileDatabase) GetFullHistory

func (pd *ProfileDatabase) GetFullHistory() ([]*entity.UserHistory, error)

func (*ProfileDatabase) GetModerators

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

func (*ProfileDatabase) GetSubscriptions

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

func (*ProfileDatabase) GetUserHistory

func (pd *ProfileDatabase) GetUserHistory(id *entity.ID) (*entity.UserHistory, error)

func (*ProfileDatabase) PutModerator

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

func (*ProfileDatabase) PutSubscription

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

func (*ProfileDatabase) PutUserHistory

func (pd *ProfileDatabase) PutUserHistory(h *entity.UserHistory) error

func (*ProfileDatabase) RemoveModerator

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

func (*ProfileDatabase) RemoveSubscription

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