Documentation ¶
Overview ¶
templ: version: v0.2.513
Index ¶
- func CreateMiddleware(service Service) func(next http.Handler) http.Handler
- func GetUser(r *http.Request) *models.User
- func RequiredMiddleware(next http.Handler) http.Handler
- type Auth
- func (a *Auth) Authenticate(ctx context.Context, username, password string) (*models.User, error)
- func (a *Auth) CreateSession(user *models.User) (*models.Session, error)
- func (a *Auth) CreateUser(ctx context.Context, username, password string) (*models.User, error)
- func (a *Auth) Mount(router chi.Router)
- func (a *Auth) ValidateSession(session *models.Session) error
- type Repository
- type RepositoryImpl
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Authenticate ¶
func (*Auth) CreateSession ¶
func (*Auth) CreateUser ¶
type Repository ¶
type RepositoryImpl ¶
type RepositoryImpl struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sqlx.DB) *RepositoryImpl
func (*RepositoryImpl) GetByUsername ¶
func (r *RepositoryImpl) GetByUsername(ctx context.Context, username string) (*models.UserCredentials, error)
func (*RepositoryImpl) Insert ¶
func (r *RepositoryImpl) Insert(ctx context.Context, username, password, salt string) (*models.UserCredentials, error)
Click to show internal directories.
Click to hide internal directories.