Documentation ¶
Index ¶
- type AuthRepository
- func (r *AuthRepository) CheckAccessToken(token string) (accessToken models.Accesstoken, err error)
- func (r *AuthRepository) CreateAccessToken(accessToken string, user models.User) models.Accesstoken
- func (r *AuthRepository) CreateUser(username string, password string, fullname string) models.User
- func (r *AuthRepository) GetUser(username string, password string) (user models.User, err error)
- type IAuthRepository
- type IMessageRepository
- type IUserRepository
- type MessageRepository
- type Messages
- type MockAuthRepository
- func (m *MockAuthRepository) CheckAccessToken(token string) (accessToken models.Accesstoken, err error)
- func (m *MockAuthRepository) CreateAccessToken(accessToken string, user models.User) models.Accesstoken
- func (m *MockAuthRepository) CreateUser(username string, password string, fullname string) models.User
- func (m *MockAuthRepository) GetUser(username string, password string) (user models.User, err error)
- type MockMessageRepository
- type MockUserRepository
- type UserRepository
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
AuthRepository ..
func (*AuthRepository) CheckAccessToken ¶
func (r *AuthRepository) CheckAccessToken(token string) (accessToken models.Accesstoken, err error)
CheckAccessToken checks Access Token
func (*AuthRepository) CreateAccessToken ¶
func (r *AuthRepository) CreateAccessToken(accessToken string, user models.User) models.Accesstoken
CreateAccessToken repository returns auth access Token
func (*AuthRepository) CreateUser ¶
CreateUser repository creates user
type IAuthRepository ¶
type IAuthRepository interface { CreateAccessToken(accessToken string, user models.User) models.Accesstoken GetUser(username string, password string) (user models.User, err error) CreateUser(username string, password string, fullname string) models.User CheckAccessToken(token string) (accessToken models.Accesstoken, err error) }
IAuthRepository is a interface of AuthRepository
type IMessageRepository ¶
type IMessageRepository interface { CreateMessage( fromUser models.User, toUser models.User, messageContext models.MessageCreate, ) (message models.Message) FetchUsersMessages( fromUser models.User, toUser models.User, ) Messages }
IMessageRepository is a interface of MessageRepository
type IUserRepository ¶
type IUserRepository interface { FetchUsers() Users FetchUserByID(userID uint) (user models.User, err error) FetchUserByUsername(username string) (user models.User, err error) }
IUserRepository is a interface of UserRepository
type MessageRepository ¶
type MessageRepository struct {
// contains filtered or unexported fields
}
MessageRepository ..
func (*MessageRepository) CreateMessage ¶
func (r *MessageRepository) CreateMessage( fromUser models.User, toUser models.User, messageContext models.MessageCreate, ) (message models.Message)
CreateMessage inserts message to the database
func (*MessageRepository) FetchUsersMessages ¶
func (r *MessageRepository) FetchUsersMessages( fromUser models.User, toUser models.User, ) Messages
FetchUsersMessages returns messages
type MockAuthRepository ¶
MockAuthRepository is a mock implementation for unit tests
func (*MockAuthRepository) CheckAccessToken ¶
func (m *MockAuthRepository) CheckAccessToken(token string) (accessToken models.Accesstoken, err error)
CheckAccessToken is a mocked func
func (*MockAuthRepository) CreateAccessToken ¶
func (m *MockAuthRepository) CreateAccessToken(accessToken string, user models.User) models.Accesstoken
CreateAccessToken is a mocked func
func (*MockAuthRepository) CreateUser ¶
func (m *MockAuthRepository) CreateUser(username string, password string, fullname string) models.User
CreateUser is a mocked func
type MockMessageRepository ¶
MockMessageRepository is a mock implementation for unit tests
func (*MockMessageRepository) CreateMessage ¶
func (m *MockMessageRepository) CreateMessage( fromUser models.User, toUser models.User, messageContext models.MessageCreate, ) (message models.Message)
CreateMessage is a mocked func
func (*MockMessageRepository) FetchUsersMessages ¶
func (m *MockMessageRepository) FetchUsersMessages( fromUser models.User, toUser models.User, ) Messages
FetchUsersMessages is a mocked func
type MockUserRepository ¶
MockUserRepository is a mock implementation for unit tests
func (*MockUserRepository) FetchUserByID ¶
func (m *MockUserRepository) FetchUserByID(userID uint) (user models.User, err error)
FetchUserByID is a mocked func
func (*MockUserRepository) FetchUserByUsername ¶
func (m *MockUserRepository) FetchUserByUsername(username string) (user models.User, err error)
FetchUserByUsername is a mocked func
func (*MockUserRepository) FetchUsers ¶
func (m *MockUserRepository) FetchUsers() Users
FetchUsers is a mocked func
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository ..
func NewUserRepo ¶
func NewUserRepo(db *gorm.DB) *UserRepository
NewUserRepo returns new UserRepository
func (*UserRepository) FetchUserByID ¶
func (r *UserRepository) FetchUserByID(userID uint) (user models.User, err error)
FetchUserByID repository returns user
func (*UserRepository) FetchUserByUsername ¶
func (r *UserRepository) FetchUserByUsername(username string) (user models.User, err error)
FetchUserByUsername repository returns user
func (*UserRepository) FetchUsers ¶
func (r *UserRepository) FetchUsers() Users
FetchUsers Repository returns user list