user

package
v0.0.0-...-c043ed3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTPayload

type JWTPayload struct {
	Username string `json:"username"`
	Iat      int64  `json:"iat"`
	Exp      int64  `json:"exp"`
}

type Service

type Service interface {
	Login(ctx context.Context, user User) (jwt.JWT, error)
	GetUser(ctx context.Context, receivedJwt jwt.JWT) (User, error)
	IsAdmin(ctx context.Context, username string) (bool, error)
}

func NewService

func NewService(db *sql.DB, regoPath string) Service

type User

type User struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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