port

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 3 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 uint) (types.User, error)
	GetUsersByCredential(credentialID uint) ([]types.User, error)
	PatchUser(user types.User) (types.User, error)
	GetUserCredentialsMethods(userID uint) ([]types.CredentialsMethods, error)
}

type AuthHandler

type AuthHandler interface {
	Login(c *router.Context)
	Register(c *router.Context)
	Logout(c *router.Context)
}

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 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 uint) (types.User, error)

func (*MockAuthAdapter) GetUserCredentialsMethods

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

func (*MockAuthAdapter) GetUsersByCredential

func (m *MockAuthAdapter) GetUsersByCredential(credentialID uint) ([]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 UserHandler

type UserHandler interface {
	GetCurrentUser(c *router.Context)
	PatchCurrentUser(c *router.Context)
	GetCurrentUserCredentials(c *router.Context)
}

type UserService

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

Jump to

Keyboard shortcuts

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