webserver

package
v0.0.0-...-bc78c8b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsController

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

AccountsController has the accounts routes handlers

func NewAccountsController

func NewAccountsController(repo domain.AccountsRepository, assetsRepo domain.AssetsRepository) *AccountsController

func (*AccountsController) GetAccountAssetsGroupedByStateHandler

func (a *AccountsController) GetAccountAssetsGroupedByStateHandler(w http.ResponseWriter, r *http.Request)

func (*AccountsController) GetAccountAssetsHandler

func (a *AccountsController) GetAccountAssetsHandler(w http.ResponseWriter, r *http.Request)

func (*AccountsController) GetAccountHandler

func (a *AccountsController) GetAccountHandler(w http.ResponseWriter, r *http.Request)

type ApplicationsController

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

ApplicationsController has the accounts routes handlers

func NewApplicationsController

func NewApplicationsController(service domain.ApplicationService) *ApplicationsController

func (*ApplicationsController) ApplicationItemHandler

func (a *ApplicationsController) ApplicationItemHandler(w http.ResponseWriter, r *http.Request)

func (*ApplicationsController) DeleteApplicationByIDHandler

func (a *ApplicationsController) DeleteApplicationByIDHandler(w http.ResponseWriter, r *http.Request)

func (*ApplicationsController) GetApplicationLogEventsHandler

func (a *ApplicationsController) GetApplicationLogEventsHandler(w http.ResponseWriter, r *http.Request)

func (*ApplicationsController) GetApplicationStateHandler

func (a *ApplicationsController) GetApplicationStateHandler(w http.ResponseWriter, r *http.Request)

GetApplicationStateHandler returns state of application on each price change

func (*ApplicationsController) GetApplicationsHandler

func (a *ApplicationsController) GetApplicationsHandler(w http.ResponseWriter, r *http.Request)

func (*ApplicationsController) GetLastApplicationStateHandler

func (a *ApplicationsController) GetLastApplicationStateHandler(w http.ResponseWriter, r *http.Request)

type AssetsPricesController

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

AssetsPricesController has the assets prices routes handlers

func NewAssetsPricesController

func NewAssetsPricesController(repo domain.AssetPriceRepository) *AssetsPricesController

NewAssetsPricesController returns an instance of AssetsPricesController

func (*AssetsPricesController) GetAssetPrices

func (a *AssetsPricesController) GetAssetPrices(w http.ResponseWriter, r *http.Request)

GetAssetPrices returns prices of the asset between a start date and an end date

type BenchmarkAPIOutput

type BenchmarkAPIOutput struct {
	Prices  [][]float32    `json:"prices"`
	Balance [][]float32    `json:"balance"`
	Buys    [][]float32    `json:"buys"`
	Sells   [][]float32    `json:"sells"`
	Assets  []domain.Asset `json:"assets"`
}

BenchmarkAPIOutput is a easy format to be read by charts

type BenchmarkController

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

BenchmarkController has the handlers of benchmark routes

func NewBenchmarkController

func NewBenchmarkController(benchmark domain.BenchmarkService, application domain.ApplicationService) *BenchmarkController

NewBenchmarkController returns an instance of BenchmarkController

func (*BenchmarkController) BenchmarkHandler

func (b *BenchmarkController) BenchmarkHandler(w http.ResponseWriter, r *http.Request)

BenchmarkHandler handles benchmark routes

func (*BenchmarkController) CreateBenchmark

func (b *BenchmarkController) CreateBenchmark(w http.ResponseWriter, r *http.Request)

CreateBenchmark handles request for creating benchmark in database and starting the benchmark execution

func (*BenchmarkController) DeleteBenchmark

func (b *BenchmarkController) DeleteBenchmark(w http.ResponseWriter, r *http.Request)

DeleteBenchmark handles request for deleting benchmark

func (*BenchmarkController) GetBenchmarkDataSourcesHandler

func (b *BenchmarkController) GetBenchmarkDataSourcesHandler(w http.ResponseWriter, r *http.Request)

GetBenchmarkDataSources returns list of all available data sources

func (*BenchmarkController) GetBenchmarkExecutionStateHandler

func (b *BenchmarkController) GetBenchmarkExecutionStateHandler(w http.ResponseWriter, r *http.Request)

GetBenchmarkExecutionStateHandler returns state of application on each price change

func (*BenchmarkController) GetBenchmarks

func (b *BenchmarkController) GetBenchmarks(w http.ResponseWriter, r *http.Request)

GetBenchmarks returns all existing benchmarks

func (*BenchmarkController) ResourceHandler

func (b *BenchmarkController) ResourceHandler(w http.ResponseWriter, r *http.Request)

ResourceHandler handles benchmark routes releated with a benchmark result

type CryptoTradingServer

type CryptoTradingServer struct {
	http.Handler
}

CryptoTradingServer provides server that handles application API

func NewCryptoTradingServer

func NewCryptoTradingServer(
	benchmark *benchmark.Service,
	assetsPrice domain.AssetPriceRepository,
	accounts domain.AccountsRepository,
	assets domain.AssetsRepository,
	appService domain.ApplicationService,
) (*CryptoTradingServer, error)

NewCryptoTradingServer returns an instance of CryptoTradingServer

Jump to

Keyboard shortcuts

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