Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBQuery ¶
type DBQuery interface { ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) PingContext(ctx context.Context) error Begin() (*sql.Tx, error) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row Prepare(query string) (*sql.Stmt, error) }
type PostgresStorage ¶
func NewPostgresStorage ¶
func NewPostgresStorage(dsn string) (*PostgresStorage, error)
NewPostgresStorage PostgresStorage настройка подключения к БД
type SessionManager ¶
func NewSessionStorage ¶
func NewSessionStorage() SessionManager
type SessionStorage ¶
type SessionStorage struct {
// contains filtered or unexported fields
}
SessionStorage данные по авторизованным пользователям
func (*SessionStorage) IsValid ¶
func (s *SessionStorage) IsValid(token string) bool
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(db DBQuery) (*Transaction, error)
NewTransaction Открывает новую транзакцию
func (*Transaction) AddError ¶
func (t *Transaction) AddError(e error)
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) Error ¶
func (t *Transaction) Error() []error
func (*Transaction) QueryRowContext ¶
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
func (*Transaction) Tx ¶
func (t *Transaction) Tx() *sql.Tx
Click to show internal directories.
Click to hide internal directories.