store

package
v0.0.0-...-794b143 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func New

func New(config *StoreConfig) *Store

func (*Store) Close

func (s *Store) Close()

func (*Store) Open

func (s *Store) Open() error

func (*Store) User

func (s *Store) User() *UserRepository

type StoreConfig

type StoreConfig struct {
	DBParams   string
	DBURL      string
	DBHostname string `toml:"db_hostname"`
	DBPort     int    `toml:"db_port"`
	DBName     string `toml:"db_name"`
	DBUsername string `toml:"db_user"`
	DBPassword string `toml:"db_pass"`
	DBSSLMode  bool   `toml:"db_sslmode"`
	LogLevel   string `toml:"log_level"`
}

func NewConfig

func NewConfig() *StoreConfig

func ReadConfig

func ReadConfig(path string) *StoreConfig

func (*StoreConfig) BuildDBComplexFields

func (c *StoreConfig) BuildDBComplexFields()

type UserRepository

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

func (*UserRepository) Create

func (r *UserRepository) Create(u *models.User) (*models.User, error)

func (*UserRepository) FindByTelegramID

func (r *UserRepository) FindByTelegramID(id int) (*models.User, error)

Jump to

Keyboard shortcuts

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