api

package
v0.0.0-...-8ad1ab3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandlers

type AuthHandlers struct {
	// contains filtered or unexported fields
}

func CreateAuthHandlers

func CreateAuthHandlers(authManager managers.AuthManager, logger *log.Logger) *AuthHandlers

func (*AuthHandlers) Connect

func (handler *AuthHandlers) Connect(rg *gin.RouterGroup, authMiddleware *middleware.AuthMiddleware)

type BusinessHandlers

type BusinessHandlers struct {
	// contains filtered or unexported fields
}

func CreateBusinessHandlers

func CreateBusinessHandlers(
	businessManager BusinessManager, transactionManager TransactionManager,
	itemDefinitionManager ItemDefinitionManager,
	userAuthorizedAcessor UserAuthorizedAccessor, businessAuthorizedAccessor BusinessAuthorizedAccessor,
	authorizedTransactionAccessor AuthorizedTransactionAccessor,
	logger *log.Logger) *BusinessHandlers

func (*BusinessHandlers) Connect

func (handler *BusinessHandlers) Connect(rg *gin.RouterGroup)

type FileHandlers

type FileHandlers struct {
	// contains filtered or unexported fields
}

FileHandlers is a struct that implements handlers for all operations under "/file/" URL path. Operations include: uploading files to existing FileMetadata, deleting files from FileMetadata and downloading files (does not require the requester to be the owner of the file).

func CreateFileHandlers

func CreateFileHandlers(fileStorageService FileStorageService, logger *log.Logger,
	userAuthorizedAcessor UserAuthorizedAccessor) *FileHandlers

func (*FileHandlers) Connect

func (handler *FileHandlers) Connect(rg *gin.RouterGroup)

type ItemDefinitionHandlers

type ItemDefinitionHandlers struct {
	// contains filtered or unexported fields
}

func (*ItemDefinitionHandlers) Connect

func (handler *ItemDefinitionHandlers) Connect(rg *gin.RouterGroup)

type UserHandlers

type UserHandlers struct {
	// contains filtered or unexported fields
}

UserHandlers stores UserLocalCardHandlers and UserVirtualCardHandlers. It also implements few requests related to functionalities for users that did not fit other handlers. (currently retrieving a list of local and virtual cards, searching for businesses) Retrieval of local and virtual cards is coupled in a single request to limit number of requests made by the application. All requests require middleware that will insert user object into the context under "user". Such middleware has to be set up by owner of the external router group (whoever calls UserHandlers.Connect).

func CreateUserHandlers

func CreateUserHandlers(
	virtualCardManager VirtualCardManager,
	localCardManager LocalCardManager,
	businessManager BusinessManager,
	transactionManager TransactionManager,
	itemDefinitionManager ItemDefinitionManager,
	userAuthorizedAcessor UserAuthorizedAccessor,
	authorizedTransactionAccessor AuthorizedTransactionAccessor,
	logger *log.Logger,
	baseURL string,
) *UserHandlers

Creates UserHandlers. UserHandlers "owns" UserVirtualCardHandlers and UserLocalCardHandlers, hence these two structs are created in this function, not passed as arguments.

func (*UserHandlers) Connect

func (handler *UserHandlers) Connect(rg *gin.RouterGroup)

Connects handler to gin router

type UserLocalCardHandlers

type UserLocalCardHandlers struct {
	// contains filtered or unexported fields
}

UserLocalCardHandlers implements API handlers for requests related to managing local cards (creating, deleting, retrieving types of cards). All requests require middleware that will insert user object into the context under "user".

func (*UserLocalCardHandlers) Connect

func (handler *UserLocalCardHandlers) Connect(rg *gin.RouterGroup)

Connects UserLocalCardHandlers to gin router

type UserVirtualCardHandlers

type UserVirtualCardHandlers struct {
	// contains filtered or unexported fields
}

func (*UserVirtualCardHandlers) Connect

func (handler *UserVirtualCardHandlers) Connect(rg *gin.RouterGroup)

Jump to

Keyboard shortcuts

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