usecase

package
v0.0.0-...-4db4453 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.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 AuthClaims

type AuthClaims struct {
	jwt.StandardClaims
	//User *models.User `json:"user"`
	User *UserInfo `json:"user"`
}

type AuthUseCase

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

func NewAuthUseCase

func NewAuthUseCase(
	userRepo auth.UserRepository,
	hashSalt string,
	signingKey []byte,
	tokenTTLSeconds time.Duration) *AuthUseCase

func (*AuthUseCase) ParseToken

func (a *AuthUseCase) ParseToken(ctx context.Context, accessToken string) (*models.User, error)

func (*AuthUseCase) SignIn

func (a *AuthUseCase) SignIn(ctx context.Context, username, password string) (string, error)

func (*AuthUseCase) SignUp

func (a *AuthUseCase) SignUp(ctx context.Context, username, password string) (string, error)

type AuthUseCaseMock

type AuthUseCaseMock struct {
	mock.Mock
}

func (*AuthUseCaseMock) ParseToken

func (m *AuthUseCaseMock) ParseToken(ctx context.Context, accessToken string) (*models.User, error)

func (*AuthUseCaseMock) SignIn

func (m *AuthUseCaseMock) SignIn(ctx context.Context, username, password string) (string, error)

func (*AuthUseCaseMock) SignUp

func (m *AuthUseCaseMock) SignUp(ctx context.Context, username, password string) error

type UserInfo

type UserInfo struct {
	ID       string
	Username string
}

Jump to

Keyboard shortcuts

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