factory

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewComponentsHandler

func NewComponentsHandler(
	cfg config.Config,
	sqlitePath string,
	jwtKey string,
	emailsConfig config.EmailsConfig,
	appVersion string,
	swaggerPath string,
	emailSender api.EmailSender,
	captchaWrapper api.CaptchaHandler,
) (*componentsHandler, error)

NewComponentsHandler creates a new instance of the components handler holding all high-level components

Types

type APIEngine

type APIEngine interface {
	Address() string
	Close() error
}

APIEngine defines the operations for a component able to serve the API

type CaptchaHTTPHandler

type CaptchaHTTPHandler interface {
	GenerateCaptchaHandler(w http.ResponseWriter, r *http.Request)
	ServeCaptchaImageHandler(w http.ResponseWriter, r *http.Request)
}

CaptchaHTTPHandler defines the operations for a component able to generate & test captchas

type GatewayTester

type GatewayTester interface {
	TestGateways(gateways []config.GatewayConfig) error
}

GatewayTester defines the operations for a component able to test (probe) gateways

type RequestsProcessor

type RequestsProcessor interface {
	ServeHTTP(writer http.ResponseWriter, request *http.Request)
	IsInterfaceNil() bool
}

RequestsProcessor defines the operations for a component able to process requests

type RequestsSynchronizer

type RequestsSynchronizer interface {
	Process()
	IsInterfaceNil() bool
}

RequestsSynchronizer defines the operations for a component able to synchronize requests

type SQLiteWrapper

type SQLiteWrapper interface {
	AddUser(username string, password string, isAdmin bool, maxRequests uint64, isPremium bool, isActive bool, activationToken string) error
	RemoveUser(username string) error
	UpdateUser(username string, password string, isAdmin bool, maxRequests uint64, isPremium bool) error
	AddKey(username string, key string) error
	RemoveKey(username string, key string) error
	IsKeyAllowed(key string) (string, common.AccountType, error)
	CheckUserCredentials(username string, password string) (*common.UsersDetails, error)
	GetUser(username string) (*common.UsersDetails, error)
	GetAllKeys(username string) (map[string]common.AccessKeyDetails, error)
	GetAllUsers() (map[string]common.UsersDetails, error)
	ActivateUser(token string) error
	AddPerformanceMetricAsync(label string)
	GetPerformanceMetrics() (map[string]uint64, error)
	UpdatePassword(username string, password string) error
	RequestEmailChange(username string, newEmail string, token string) error
	ConfirmEmailChange(token string) (string, error)
	SetCryptoPaymentID(username string, paymentID uint64) error
	UpdateMaxRequests(username string, maxRequests uint64) error
	UpdateUserMaxRequestsFromContract(username string, contractMaxRequests uint64) error
	Close() error
	IsInterfaceNil() bool
}

SQLiteWrapper defines the operations for a component able to wrap SQLite database

Jump to

Keyboard shortcuts

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