sqldb

package
v0.0.0-...-5dd6bc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlDB

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

SqlDB implements Storage interface

func NewDB

func NewDB(dbFile string) (*SqlDB, error)

NewDB creates new database

func (*SqlDB) Add

func (db *SqlDB) Add(subscription storage.Subscription) error

Add inserts new subscription

func (*SqlDB) Close

func (db *SqlDB) Close() error

Close closes database

func (*SqlDB) Delete

func (db *SqlDB) Delete(id int64) error

Delete removes subscription

func (*SqlDB) Get

func (db *SqlDB) Get(clientId int64) ([]storage.Subscription, error)

Get gets all client subscriptions

func (*SqlDB) GetAllActive

func (db *SqlDB) GetAllActive() ([]storage.Subscription, error)

GetAllActive gets all active subscriptions for all clients

func (*SqlDB) Update

func (db *SqlDB) Update(subscription storage.Subscription) error

Update updates subscription

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL