Documentation ¶
Index ¶
- func NewBlockStore(db *sql.DB, lock *sync.Mutex) repo.BlockStore
- func NewConfigStore(db *sql.DB, lock *sync.Mutex, path string) repo.ConfigStore
- func NewDeviceStore(db *sql.DB, lock *sync.Mutex) repo.DeviceStore
- func NewNotificationStore(db *sql.DB, lock *sync.Mutex) repo.NotificationStore
- func NewOfflineMessageStore(db *sql.DB, lock *sync.Mutex) repo.OfflineMessageStore
- func NewPeerStore(db *sql.DB, lock *sync.Mutex) repo.PeerStore
- func NewPinRequestStore(db *sql.DB, lock *sync.Mutex) repo.PinRequestStore
- func NewPointerStore(db *sql.DB, lock *sync.Mutex) repo.PointerStore
- func NewProfileStore(db *sql.DB, lock *sync.Mutex) repo.ProfileStore
- func NewThreadStore(db *sql.DB, lock *sync.Mutex) repo.ThreadStore
- type BlockDB
- func (c *BlockDB) Add(block *repo.Block) error
- func (m *BlockDB) BeginTransaction() (*sql.Tx, error)
- func (c *BlockDB) Count(query string) int
- func (c *BlockDB) Delete(id string) error
- func (c *BlockDB) DeleteByThreadId(threadId string) error
- func (m *BlockDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (c *BlockDB) Get(id string) *repo.Block
- func (c *BlockDB) GetByDataId(dataId string) *repo.Block
- func (c *BlockDB) List(offset string, limit int, query string) []repo.Block
- func (m *BlockDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *BlockDB) PrepareQuery(query string) (*sql.Stmt, error)
- type ConfigDB
- type DeviceDB
- func (c *DeviceDB) Add(device *repo.Device) error
- func (m *DeviceDB) BeginTransaction() (*sql.Tx, error)
- func (c *DeviceDB) Count(query string) int
- func (c *DeviceDB) Delete(id string) error
- func (m *DeviceDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (c *DeviceDB) Get(id string) *repo.Device
- func (c *DeviceDB) List(query string) []repo.Device
- func (m *DeviceDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *DeviceDB) PrepareQuery(query string) (*sql.Stmt, error)
- type NotificationDB
- func (c *NotificationDB) Add(notification *repo.Notification) error
- func (m *NotificationDB) BeginTransaction() (*sql.Tx, error)
- func (c *NotificationDB) CountUnread() int
- func (c *NotificationDB) Delete(id string) error
- func (c *NotificationDB) DeleteByActorId(actorId string) error
- func (c *NotificationDB) DeleteByBlockId(blockId string) error
- func (c *NotificationDB) DeleteBySubjectId(subjectId string) error
- func (m *NotificationDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (c *NotificationDB) Get(id string) *repo.Notification
- func (c *NotificationDB) List(offset string, limit int, query string) []repo.Notification
- func (m *NotificationDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *NotificationDB) PrepareQuery(query string) (*sql.Stmt, error)
- func (c *NotificationDB) Read(id string) error
- func (c *NotificationDB) ReadAll() error
- type OfflineMessageDB
- func (m *OfflineMessageDB) BeginTransaction() (*sql.Tx, error)
- func (o *OfflineMessageDB) DeleteMessage(url string) error
- func (m *OfflineMessageDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (o *OfflineMessageDB) GetMessages() (map[string][]byte, error)
- func (o *OfflineMessageDB) Has(url string) bool
- func (m *OfflineMessageDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *OfflineMessageDB) PrepareQuery(query string) (*sql.Stmt, error)
- func (o *OfflineMessageDB) Put(url string) error
- func (o *OfflineMessageDB) SetMessage(url string, message []byte) error
- type PeerDB
- func (c *PeerDB) Add(peer *repo.Peer) error
- func (m *PeerDB) BeginTransaction() (*sql.Tx, error)
- func (c *PeerDB) Count(query string, distinct bool) int
- func (c *PeerDB) Delete(id string, threadId string) error
- func (c *PeerDB) DeleteByThreadId(threadId string) error
- func (m *PeerDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (c *PeerDB) Get(row string) *repo.Peer
- func (c *PeerDB) GetById(id string) *repo.Peer
- func (c *PeerDB) List(offset string, limit int, query string) []repo.Peer
- func (m *PeerDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *PeerDB) PrepareQuery(query string) (*sql.Stmt, error)
- type PinRequestDB
- func (m *PinRequestDB) BeginTransaction() (*sql.Tx, error)
- func (c *PinRequestDB) Delete(id string) error
- func (m *PinRequestDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (c *PinRequestDB) List(offset string, limit int) []repo.PinRequest
- func (m *PinRequestDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *PinRequestDB) PrepareQuery(query string) (*sql.Stmt, error)
- func (c *PinRequestDB) Put(pr *repo.PinRequest) error
- type PointersDB
- func (m *PointersDB) BeginTransaction() (*sql.Tx, error)
- func (p *PointersDB) Delete(id peer.ID) error
- func (p *PointersDB) DeleteAll(purpose repo.Purpose) error
- func (m *PointersDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (p *PointersDB) Get(id peer.ID) *repo.Pointer
- func (p *PointersDB) GetAll() ([]repo.Pointer, error)
- func (p *PointersDB) GetByPurpose(purpose repo.Purpose) ([]repo.Pointer, error)
- func (m *PointersDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *PointersDB) PrepareQuery(query string) (*sql.Stmt, error)
- func (p *PointersDB) Put(pointer repo.Pointer) error
- type ProfileDB
- func (c *ProfileDB) GetAvatarId() (*string, error)
- func (c *ProfileDB) GetTokens() (*repo.CafeTokens, error)
- func (c *ProfileDB) GetUsername() (*string, error)
- func (c *ProfileDB) SetAvatarId(id string) error
- func (c *ProfileDB) SignIn(username string, tokens *repo.CafeTokens) error
- func (c *ProfileDB) SignOut() error
- func (c *ProfileDB) UpdateTokens(tokens *repo.CafeTokens) error
- type SQLiteDatastore
- func (d *SQLiteDatastore) Blocks() repo.BlockStore
- func (d *SQLiteDatastore) Close()
- func (d *SQLiteDatastore) Config() repo.ConfigStore
- func (d *SQLiteDatastore) Copy(dbPath string, password string) error
- func (d *SQLiteDatastore) Devices() repo.DeviceStore
- func (d *SQLiteDatastore) InitTables(password string) error
- func (d *SQLiteDatastore) Notifications() repo.NotificationStore
- func (d *SQLiteDatastore) OfflineMessages() repo.OfflineMessageStore
- func (d *SQLiteDatastore) Peers() repo.PeerStore
- func (d *SQLiteDatastore) PinRequests() repo.PinRequestStore
- func (d *SQLiteDatastore) Ping() error
- func (d *SQLiteDatastore) Pointers() repo.PointerStore
- func (d *SQLiteDatastore) Profile() repo.ProfileStore
- func (d *SQLiteDatastore) Threads() repo.ThreadStore
- type ThreadDB
- func (c *ThreadDB) Add(thread *repo.Thread) error
- func (m *ThreadDB) BeginTransaction() (*sql.Tx, error)
- func (c *ThreadDB) Count(query string) int
- func (c *ThreadDB) Delete(id string) error
- func (m *ThreadDB) ExecuteQuery(query string, args ...interface{}) (sql.Result, error)
- func (c *ThreadDB) Get(id string) *repo.Thread
- func (c *ThreadDB) List(query string) []repo.Thread
- func (m *ThreadDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
- func (m *ThreadDB) PrepareQuery(query string) (*sql.Stmt, error)
- func (c *ThreadDB) UpdateHead(id string, head string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBlockStore ¶
func NewConfigStore ¶
func NewDeviceStore ¶
func NewNotificationStore ¶
func NewOfflineMessageStore ¶
func NewPinRequestStore ¶
func NewPointerStore ¶
func NewProfileStore ¶
func NewThreadStore ¶
Types ¶
type BlockDB ¶
type BlockDB struct {
// contains filtered or unexported fields
}
func (*BlockDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*BlockDB) DeleteByThreadId ¶
func (*BlockDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*BlockDB) PrepareAndExecuteQuery ¶
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
type ConfigDB ¶
type ConfigDB struct {
// contains filtered or unexported fields
}
func (*ConfigDB) IsEncrypted ¶
type DeviceDB ¶
type DeviceDB struct {
// contains filtered or unexported fields
}
func (*DeviceDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*DeviceDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*DeviceDB) PrepareAndExecuteQuery ¶
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
type NotificationDB ¶
type NotificationDB struct {
// contains filtered or unexported fields
}
func (*NotificationDB) Add ¶
func (c *NotificationDB) Add(notification *repo.Notification) error
func (*NotificationDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*NotificationDB) CountUnread ¶
func (c *NotificationDB) CountUnread() int
func (*NotificationDB) Delete ¶
func (c *NotificationDB) Delete(id string) error
func (*NotificationDB) DeleteByActorId ¶
func (c *NotificationDB) DeleteByActorId(actorId string) error
func (*NotificationDB) DeleteByBlockId ¶
func (c *NotificationDB) DeleteByBlockId(blockId string) error
func (*NotificationDB) DeleteBySubjectId ¶
func (c *NotificationDB) DeleteBySubjectId(subjectId string) error
func (*NotificationDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*NotificationDB) Get ¶
func (c *NotificationDB) Get(id string) *repo.Notification
func (*NotificationDB) List ¶
func (c *NotificationDB) List(offset string, limit int, query string) []repo.Notification
func (*NotificationDB) PrepareAndExecuteQuery ¶
func (m *NotificationDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
func (*NotificationDB) PrepareQuery ¶
PrepareQuery returns a *sql.Stmt to the wrapped DB
func (*NotificationDB) Read ¶
func (c *NotificationDB) Read(id string) error
func (*NotificationDB) ReadAll ¶
func (c *NotificationDB) ReadAll() error
type OfflineMessageDB ¶
type OfflineMessageDB struct {
// contains filtered or unexported fields
}
func (*OfflineMessageDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*OfflineMessageDB) DeleteMessage ¶
func (o *OfflineMessageDB) DeleteMessage(url string) error
func (*OfflineMessageDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*OfflineMessageDB) GetMessages ¶
func (o *OfflineMessageDB) GetMessages() (map[string][]byte, error)
func (*OfflineMessageDB) Has ¶
func (o *OfflineMessageDB) Has(url string) bool
func (*OfflineMessageDB) PrepareAndExecuteQuery ¶
func (m *OfflineMessageDB) PrepareAndExecuteQuery(query string, args ...interface{}) (*sql.Rows, error)
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
func (*OfflineMessageDB) PrepareQuery ¶
PrepareQuery returns a *sql.Stmt to the wrapped DB
func (*OfflineMessageDB) Put ¶
func (o *OfflineMessageDB) Put(url string) error
func (*OfflineMessageDB) SetMessage ¶
func (o *OfflineMessageDB) SetMessage(url string, message []byte) error
type PeerDB ¶
type PeerDB struct {
// contains filtered or unexported fields
}
func (*PeerDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*PeerDB) DeleteByThreadId ¶
func (*PeerDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*PeerDB) PrepareAndExecuteQuery ¶
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
type PinRequestDB ¶
type PinRequestDB struct {
// contains filtered or unexported fields
}
func (*PinRequestDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*PinRequestDB) Delete ¶
func (c *PinRequestDB) Delete(id string) error
func (*PinRequestDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*PinRequestDB) List ¶
func (c *PinRequestDB) List(offset string, limit int) []repo.PinRequest
func (*PinRequestDB) PrepareAndExecuteQuery ¶
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
func (*PinRequestDB) PrepareQuery ¶
PrepareQuery returns a *sql.Stmt to the wrapped DB
func (*PinRequestDB) Put ¶
func (c *PinRequestDB) Put(pr *repo.PinRequest) error
type PointersDB ¶
type PointersDB struct {
// contains filtered or unexported fields
}
func (*PointersDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*PointersDB) Delete ¶
func (p *PointersDB) Delete(id peer.ID) error
func (*PointersDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*PointersDB) Get ¶
func (p *PointersDB) Get(id peer.ID) *repo.Pointer
func (*PointersDB) GetByPurpose ¶
func (*PointersDB) PrepareAndExecuteQuery ¶
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
func (*PointersDB) PrepareQuery ¶
PrepareQuery returns a *sql.Stmt to the wrapped DB
type ProfileDB ¶
type ProfileDB struct {
// contains filtered or unexported fields
}
func (*ProfileDB) GetAvatarId ¶
func (*ProfileDB) GetUsername ¶
func (*ProfileDB) SetAvatarId ¶
func (*ProfileDB) SignIn ¶
func (c *ProfileDB) SignIn(username string, tokens *repo.CafeTokens) error
func (*ProfileDB) UpdateTokens ¶
func (c *ProfileDB) UpdateTokens(tokens *repo.CafeTokens) error
type SQLiteDatastore ¶
type SQLiteDatastore struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(repoPath, password string) (*SQLiteDatastore, error)
func (*SQLiteDatastore) Blocks ¶
func (d *SQLiteDatastore) Blocks() repo.BlockStore
func (*SQLiteDatastore) Close ¶
func (d *SQLiteDatastore) Close()
func (*SQLiteDatastore) Config ¶
func (d *SQLiteDatastore) Config() repo.ConfigStore
func (*SQLiteDatastore) Devices ¶
func (d *SQLiteDatastore) Devices() repo.DeviceStore
func (*SQLiteDatastore) InitTables ¶
func (d *SQLiteDatastore) InitTables(password string) error
func (*SQLiteDatastore) Notifications ¶
func (d *SQLiteDatastore) Notifications() repo.NotificationStore
func (*SQLiteDatastore) OfflineMessages ¶
func (d *SQLiteDatastore) OfflineMessages() repo.OfflineMessageStore
func (*SQLiteDatastore) Peers ¶
func (d *SQLiteDatastore) Peers() repo.PeerStore
func (*SQLiteDatastore) PinRequests ¶
func (d *SQLiteDatastore) PinRequests() repo.PinRequestStore
func (*SQLiteDatastore) Ping ¶
func (d *SQLiteDatastore) Ping() error
func (*SQLiteDatastore) Pointers ¶
func (d *SQLiteDatastore) Pointers() repo.PointerStore
func (*SQLiteDatastore) Profile ¶
func (d *SQLiteDatastore) Profile() repo.ProfileStore
func (*SQLiteDatastore) Threads ¶
func (d *SQLiteDatastore) Threads() repo.ThreadStore
type ThreadDB ¶
type ThreadDB struct {
// contains filtered or unexported fields
}
func (*ThreadDB) BeginTransaction ¶
Begin returns a *sql.Tx for transactional query support
func (*ThreadDB) ExecuteQuery ¶
ExecuteQuery returns the *sql.Result for the executed query without returning Rows
func (*ThreadDB) PrepareAndExecuteQuery ¶
PrepareAndExecuteQuery returns the resulting *sql.Rows for the executed query
func (*ThreadDB) PrepareQuery ¶
PrepareQuery returns a *sql.Stmt to the wrapped DB