data

package
v0.0.0-...-a11f1b2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnOptions

type ConnOptions struct {
	Name     string
	Host     string
	User     string
	Port     string
	Password string
}

func (ConnOptions) ConnString

func (c ConnOptions) ConnString() string

func (ConnOptions) Describe

func (c ConnOptions) Describe() string

type Identifier

type Identifier interface {
	Identify(username, password string) (model.User, error)
}

type Mock

type Mock struct {
}

func (Mock) Identify

func (m Mock) Identify(email, password string) (uint, error)

func (Mock) Register

func (m Mock) Register(user model.User) (uint, error)

type Postgres

type Postgres struct {
	ConnOptions
	Logger *log.Logger
}

func NewPostgres

func NewPostgres(options ConnOptions, l *log.Logger) *Postgres

func (Postgres) Connect

func (p Postgres) Connect() (*sqlx.DB, error)

func (Postgres) Identify

func (p Postgres) Identify(email, password string) (model.User, error)

func (Postgres) Register

func (p Postgres) Register(user model.User) (uint, error)

type Registrar

type Registrar interface {
	Register(user model.User) (uint, error)
}

Jump to

Keyboard shortcuts

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