domain

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 2 Imported by: 0

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 Token

type Token interface {
	GetAccessToken() string
	GetRefreshToken() string
}

Token contain accessToken and refreshToken

type TokenDetail

type TokenDetail interface {
	GetTokenID() string
	GetUserID() string
}

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 ...

Jump to

Keyboard shortcuts

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