api

package
v0.0.0-...-2921379 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncorrectCredentials = fmt.Errorf("error authentication: invalid credentials")
View Source
var ErrUserIsDisabled = fmt.Errorf("error authentication: user login disabled")

Functions

This section is empty.

Types

type Service

type Service struct {
	DB *db.Queries
}

Service abstracts resources to prevent mishandling.

func New

func New(db *db.Queries) (s *Service, err error)

New initialises a new API service

func (*Service) Login

func (s *Service) Login(ctx context.Context, username, password string) (db.GetUserSecureRow, error)

Login authenticates a user to the API

Jump to

Keyboard shortcuts

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