service

package
v0.0.0-...-bbbb4e2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Services

type Services struct {
	Users Users
}

func New

func New(cfg *config.Config, repos *repository.Repositories) *Services

type SignInInput

type SignInInput struct {
	Email    string `json:"email" form:"email"`
	Password string `json:"password" form:"password"`
}

type SignUpInput

type SignUpInput struct {
	Email    string `json:"email" form:"email"`
	Password string `json:"password" form:"password"`
}

type TokenPair

type TokenPair struct {
	AccessToken  string      `json:"access_token"`
	RefreshToken string      `json:"refresh_token"`
	Subject      models.User `json:"subject"`
	MustUpdate   bool        `json:"must_update"`
}

type Users

type Users interface {
	SignIn(in SignInInput) (*TokenPair, error)
	SignUp(in SignUpInput) (*TokenPair, error)
	ValidateTokens(tokens TokenPair) (*TokenPair, error)
}

Jump to

Keyboard shortcuts

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