auth

package
v0.0.0-...-974506c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

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

Datastore implements the Repository interface

func NewDatastore

func NewDatastore(db *sql.DB) *Datastore

NewDatastore constructs a new Repository

func (*Datastore) Login

func (ds *Datastore) Login(obj *Login) error

Login verify user

func (*Datastore) VerifyEmail

func (ds *Datastore) VerifyEmail(obj *Login) error

VerifyEmail verify user

type Login

type Login struct {
	ID                    string `jsonapi:"primary,logins"`
	Username              string `jsonapi:"attr,username"`
	Password              string `jsonapi:"attr,password,omitempty"`
	Token                 string `jsonapi:"attr,token,omitempty"`
	EmailVerificationCode string `jsonapi:"attr,email_verification_code,omitempty"`
}

Login represents a logged in user session

type Repository

type Repository interface {
	Login(obj *Login) error
	VerifyEmail(obj *Login) error
}

Repository helps to manage login

Jump to

Keyboard shortcuts

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