core

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPrivateKeyPath         = "PRIVATE_KEY_PATH"
	EnvAccessTokenExpireTime  = "ACCESS_TOKEN_EXPIRE_TIME"
	EnvRefreshTokenExpireTime = "REFRESH_TOKEN_EXPIRE_TIME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateRecord added in v0.3.0

type AuthenticateRecord struct {
	UserId       uuid.UUID
	Authenticate *adapter.AuthenticateDTO
}

type AuthenticateResponse added in v0.3.0

type AuthenticateResponse struct {
	TokenResponse *adapter.TokenResponseDTO
	Err           error
}

type CoreMock added in v0.3.0

type CoreMock struct {
	CreateUserRecordArray       []*AuthenticateRecord
	LoginUserRecordArray        []*AuthenticateRecord
	RefreshTokenRecordArray     []*RefreshTokenRecord
	UpdatePasswordRecordArray   []*AuthenticateRecord
	DeleteUserRecordArray       []*DeleteUserRecord
	CreateUserResponseArray     []*ErrorResponse
	LoginUserResponseArray      []*AuthenticateResponse
	RefreshTokenResponseArray   []*AuthenticateResponse
	UpdatePasswordResponseArray []*ErrorResponse
	DeleteUserResponseArray     []*ErrorResponse
}

func (*CoreMock) CreateUser added in v0.3.0

func (mock *CoreMock) CreateUser(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) error

func (*CoreMock) DeleteUser added in v0.3.0

func (mock *CoreMock) DeleteUser(userId uuid.UUID) error

func (*CoreMock) LoginUser added in v0.3.0

func (mock *CoreMock) LoginUser(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) (*adapter.TokenResponseDTO, error)

func (*CoreMock) RefreshToken added in v0.3.0

func (mock *CoreMock) RefreshToken(userId uuid.UUID, refreshToken string) (*adapter.TokenResponseDTO, error)

func (*CoreMock) UpdatePassword added in v0.3.0

func (mock *CoreMock) UpdatePassword(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) error

type DeleteUserRecord added in v0.3.0

type DeleteUserRecord struct {
	UserId uuid.UUID
}

type ErrorResponse added in v0.3.0

type ErrorResponse struct {
	Err error
}

type Facade

type Facade interface {
	CreateUser(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) error
	LoginUser(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) (*adapter.TokenResponseDTO, error)
	RefreshToken(userId uuid.UUID, refreshToken string) (*adapter.TokenResponseDTO, error)
	UpdatePassword(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) error
	DeleteUser(userId uuid.UUID) error
}

type RefreshTokenRecord added in v0.3.0

type RefreshTokenRecord struct {
	UserId       uuid.UUID
	RefreshToken string
}

type UserFacade

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

func NewUserFacade

func NewUserFacade() (*UserFacade, error)

func (*UserFacade) CreateUser

func (userFacade *UserFacade) CreateUser(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) error

func (*UserFacade) DeleteUser

func (userFacade *UserFacade) DeleteUser(userId uuid.UUID) error

func (*UserFacade) LoginUser

func (userFacade *UserFacade) LoginUser(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) (*adapter.TokenResponseDTO, error)

func (*UserFacade) RefreshToken

func (userFacade *UserFacade) RefreshToken(userId uuid.UUID, refreshToken string) (*adapter.TokenResponseDTO, error)

func (*UserFacade) UpdatePassword

func (userFacade *UserFacade) UpdatePassword(userId uuid.UUID, authenticate *adapter.AuthenticateDTO) error

Jump to

Keyboard shortcuts

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