sqlite

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqliteStore

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

BoltStore implements the stores.Storage interface

func New

func New(path string) (*SqliteStore, error)

func (*SqliteStore) Close

func (s *SqliteStore) Close() error

Close closes the bolt database

func (*SqliteStore) CreateEntry

func (s *SqliteStore) CreateEntry(entry shared.Entry, id string) (*shared.Entry, error)

CreateEntry creates an entry by a given ID and returns an error

func (*SqliteStore) CreateUser added in v0.0.6

func (s *SqliteStore) CreateUser(user models.User) (*models.User, error)

func (*SqliteStore) DeleteEntry

func (s *SqliteStore) DeleteEntry(id string) error

DeleteEntry deleted an entry by a given ID and returns an error

func (*SqliteStore) FindUserByEmail added in v0.0.6

func (s *SqliteStore) FindUserByEmail(email string) (*models.User, error)

func (*SqliteStore) FindUserByToken added in v0.0.6

func (s *SqliteStore) FindUserByToken(token string) (*models.User, error)

func (*SqliteStore) GetEntryByID

func (s *SqliteStore) GetEntryByID(id string) (*shared.Entry, error)

GetEntryByID returns a entry and an error by the shorted ID

func (*SqliteStore) GetVisitors

func (s *SqliteStore) GetVisitors(id string) ([]shared.Visitor, error)

GetVisitors returns the visitors and an error of an entry

func (*SqliteStore) IncreaseVisitCounter

func (s *SqliteStore) IncreaseVisitCounter(link *shared.Entry) error

IncreaseVisitCounter increases the visit counter and sets the current time as the last visit ones gorm.expr only works on initial 0 dunno why

func (*SqliteStore) LinkUpdate added in v0.0.6

func (s *SqliteStore) LinkUpdate(link *shared.Entry) (*shared.Entry, error)
func (s *SqliteStore) LinksList() ([]*shared.Entry, error)

LinksList returns a List of all available Links formerly "entries"

func (*SqliteStore) ListStats added in v0.0.13

func (s *SqliteStore) ListStats() (*int, *int, error)

func (*SqliteStore) UserUpdateToken added in v0.0.6

func (s *SqliteStore) UserUpdateToken(id uint, token string) error

Jump to

Keyboard shortcuts

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