port

package
v0.0.0-...-5d951de Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAdapter

type AuthAdapter interface {
	CreateAccount(username string, credentials types.CredentialsArgon2id) error

	GetCredentials(login string) ([]types.CredentialsArgon2id, error)

	SaveSession(token *types.Session) error
	DeleteSession(token string) error
	GetSession(token string) (*types.Session, error)

	GetUser(username string) (types.User, error)
	GetUserByID(id uuid.UUID) (types.User, error)
	GetUsersByCredential(credentialID uuid.UUID) ([]types.User, error)
	PatchUser(user types.User) (types.User, error)
	GetUserCredentialsMethods(userID uuid.UUID) ([]types.CredentialsMethods, error)
}

type AuthHandler

type AuthHandler interface {
	Login() gin.HandlerFunc
	Register() gin.HandlerFunc
	Logout() gin.HandlerFunc
	Verify() gin.HandlerFunc
}

type AuthService

type AuthService interface {
	Login(login, password string) (types.Session, error)
	Register(login, password string) (types.Session, error)
	Logout(token string) error
	Verify(token string) (*types.Session, error)
}

type EmailAdapter

type EmailAdapter interface {
	CreateEmail(email *types.Email) error
	GetEmails(userID uuid.UUID) ([]types.Email, error)
	DeleteEmail(userID uuid.UUID, email string) error
}

type EmailHandler

type EmailHandler interface {
	CreateCurrentUserEmail() gin.HandlerFunc
	GetCurrentUserEmails() gin.HandlerFunc
	DeleteCurrentUserEmail() gin.HandlerFunc
}

type EmailService

type EmailService interface {
	CreateEmail(userID uuid.UUID, email string) (types.Email, error)
	GetEmails(userID uuid.UUID) ([]types.Email, error)
	DeleteEmail(userID uuid.UUID, email string) error
}

type MigrationService

type MigrationService interface{}

type MockAuthAdapter

type MockAuthAdapter struct{ mock.Mock }

func (*MockAuthAdapter) CreateAccount

func (m *MockAuthAdapter) CreateAccount(username string, credentials types.CredentialsArgon2id) error

func (*MockAuthAdapter) DeleteSession

func (m *MockAuthAdapter) DeleteSession(token string) error

func (*MockAuthAdapter) GetCredentials

func (m *MockAuthAdapter) GetCredentials(login string) ([]types.CredentialsArgon2id, error)

func (*MockAuthAdapter) GetSession

func (m *MockAuthAdapter) GetSession(token string) (*types.Session, error)

func (*MockAuthAdapter) GetUser

func (m *MockAuthAdapter) GetUser(username string) (types.User, error)

func (*MockAuthAdapter) GetUserByID

func (m *MockAuthAdapter) GetUserByID(id uuid.UUID) (types.User, error)

func (*MockAuthAdapter) GetUserCredentialsMethods

func (m *MockAuthAdapter) GetUserCredentialsMethods(userID uuid.UUID) ([]types.CredentialsMethods, error)

func (*MockAuthAdapter) GetUsersByCredential

func (m *MockAuthAdapter) GetUsersByCredential(credentialID uuid.UUID) ([]types.User, error)

func (*MockAuthAdapter) PatchUser

func (m *MockAuthAdapter) PatchUser(user types.User) (types.User, error)

func (*MockAuthAdapter) SaveSession

func (m *MockAuthAdapter) SaveSession(session *types.Session) error

type MockAuthService

type MockAuthService struct{ mock.Mock }

func (*MockAuthService) Login

func (m *MockAuthService) Login(login, password string) (types.Session, error)

func (*MockAuthService) Logout

func (m *MockAuthService) Logout(token string) error

func (*MockAuthService) Register

func (m *MockAuthService) Register(login, password string) (types.Session, error)

func (*MockAuthService) Verify

func (m *MockAuthService) Verify(token string) (*types.Session, error)

type MockEmailAdapter

type MockEmailAdapter struct{ mock.Mock }

func (*MockEmailAdapter) CreateEmail

func (m *MockEmailAdapter) CreateEmail(email *types.Email) error

func (*MockEmailAdapter) DeleteEmail

func (m *MockEmailAdapter) DeleteEmail(userID uuid.UUID, email string) error

func (*MockEmailAdapter) GetEmails

func (m *MockEmailAdapter) GetEmails(userID uuid.UUID) ([]types.Email, error)

type UserHandler

type UserHandler interface {
	GetCurrentUser() gin.HandlerFunc
	PatchCurrentUser() gin.HandlerFunc
	GetCurrentUserCredentials() gin.HandlerFunc
}

type UserService

type UserService interface {
	GetUser(username string) (types.User, error)
	GetUserByID(id uuid.UUID) (types.User, error)
	PatchUser(user types.User) (types.User, error)
	GetUserCredentialsMethods(userID uuid.UUID) ([]types.CredentialsMethods, error)
}

Jump to

Keyboard shortcuts

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