auth

package
v0.0.0-...-8075bb9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlers

func NewHandlers(service Service) *handlers

func NewRoutes

func NewRoutes(handlers Handlers) *routes

func NewService

func NewService(jwt JWT) (*service, error)

Types

type Handlers

type Handlers interface {
	GetPing() httprouter.Handle
	GetCurrentUser() httprouter.Handle
	PostSignIn() httprouter.Handle
}

type JWT

type JWT interface {
	Generate(ctx context.Context, data map[string]string) (*string, error)
	Validate(ctx context.Context, jwtToken string) (map[string]string, error)
}

type Service

type Service interface {
	CurrentUser(ctx context.Context, jwtToken string) (*types.CurrentUser, error)
	AuthUser(ctx context.Context, username string, pwd string) (*types.CurrentUser, error)
}

Directories

Path Synopsis
Package api defines types for external communication.
Package api defines types for external communication.
Package types defines internal types.
Package types defines internal types.

Jump to

Keyboard shortcuts

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