core

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateRecord added in v0.3.0

type AuthenticateRecord struct {
	UserId   uuid.UUID
	Password string
	InitUser bool
}

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
	DeleteInitUsersRecordArray   []*EmptyRecord
	CreateUserResponseArray      []*ErrorResponse
	LoginUserResponseArray       []*AuthenticateResponse
	RefreshTokenResponseArray    []*AuthenticateResponse
	UpdatePasswordResponseArray  []*ErrorResponse
	DeleteUserResponseArray      []*ErrorResponse
	DeleteInitUsersResponseArray []*ErrorResponse
}

func (*CoreMock) CreateUser added in v0.3.0

func (mock *CoreMock) CreateUser(userId uuid.UUID, password string, initUser bool) error

func (*CoreMock) DeleteInitUsers added in v0.7.0

func (mock *CoreMock) DeleteInitUsers() 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, password string) (*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, password string) error

type DeleteUserRecord added in v0.3.0

type DeleteUserRecord struct {
	UserId uuid.UUID
}

type EmptyRecord added in v0.7.0

type EmptyRecord struct {
}

type ErrorResponse added in v0.3.0

type ErrorResponse struct {
	Err error
}

type Facade

type Facade interface {
	CreateUser(userId uuid.UUID, password string, initUser bool) error
	LoginUser(userId uuid.UUID, password string) (*adapter.TokenResponseDTO, error)
	RefreshToken(userId uuid.UUID, refreshToken string) (*adapter.TokenResponseDTO, error)
	UpdatePassword(userId uuid.UUID, password string) 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, password string, initUser bool) error

func (*UserFacade) DeleteUser

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

func (*UserFacade) LoginUser

func (userFacade *UserFacade) LoginUser(userId uuid.UUID, password string) (*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, password string) error

Jump to

Keyboard shortcuts

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