Documentation ¶
Index ¶
Constants ¶
View Source
const AccessTokenField = "AccessToken"
AccessTokenField -
View Source
const RefreshTokenField = "RefreshToken"
RefreshTokenField -
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Register ¶
type Register interface { GetAccount() string GetPassword() string SetCreatedTime(*time.Time) SetCryptPass() error }
Register ...
type TokenDetail ¶
TokenDetail contain tokenID and userID
type TokenRepository ¶
type TokenRepository interface { CreateToken(context.Context, string) (Token, error) DeleteToken(context.Context, Token) error RefreshToken(context.Context, string) (Token, error) CheckAccessToken(context.Context, string) (TokenDetail, error) }
TokenRepository represent the token' repository cantract
type TokenUsecase ¶
type TokenUsecase interface { CreateTokenUC(context.Context, string) (Token, error) DeleteTokenUC(context.Context, Token) error RefreshTokenUC(context.Context, string) (Token, error) }
TokenUsecase represent the tokens' usercase contract
type User ¶
type User interface { GetUserID() string GetDisplayName() string GetCryptPass() []byte SetUpdatedTime(*time.Time) }
User ...
type UserRepository ¶
type UserRepository interface { RegisterUser(ctx context.Context, body Register) error GetByID(ctx context.Context, id string) (User, error) GetByAccount(ctx context.Context, account string) (User, error) }
UserRepository represent the user's repository contract
type UserUsecase ¶
type UserUsecase interface { RegisterUserUC(ctx context.Context, body Register) error GetByIDUC(ctx context.Context, id string) (User, error) GetByAccountUC(ctx context.Context, account string) (User, error) CheckAccountAndPassUC(ctx context.Context, account string, password string) (User, error) }
UserUsecase ...
Click to show internal directories.
Click to hide internal directories.