sqlstore

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRepository

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

func (*AuthRepository) Create

func (r *AuthRepository) Create(auth *model.Authorization) error

func (*AuthRepository) FindByID

func (r *AuthRepository) FindByID(id int64) (*model.Authorization, error)

func (*AuthRepository) StatsByToken

func (r *AuthRepository) StatsByToken(token string) (*model.TokenStat, error)

func (*AuthRepository) StatsByTokenPeriod

func (r *AuthRepository) StatsByTokenPeriod(from, to time.Time, token string) (*model.TokenStat, error)

func (*AuthRepository) StatsForPeriod

func (r *AuthRepository) StatsForPeriod(from, to time.Time) ([]model.AuthStat, error)

type Store

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

Store is an implementation of store.Store interface based on SQL.

func New

func New(settings *config.Database) (*Store, error)

New returns new instance of Store.

func TestDB

func TestDB(t *testing.T, conf *config.Database) (*Store, func(...string))

TestDB returns special test connection and teardown function.

func (*Store) Authorization

func (s *Store) Authorization() store.AuthRepository

Authorization returns repository, which is responsible for authorizations.

Jump to

Keyboard shortcuts

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