controllers

package
v0.0.0-...-c314e41 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *mux.Router

NewRouter ...

Types

type Server

type Server struct {
	App app.App
}

Server is a struct

func (*Server) GetBalance

func (server *Server) GetBalance(w http.ResponseWriter, r *http.Request)

GetBalance Controller @Summary Get balance @Description Calling the kraken api and get the balance @ID get-balance @Accept json @Produce json @Success 200 {object} models.Balance @Header 200 {string} Token "ok" @Failure 404 {object} http. @Router /balance [get]

func (*Server) GetLedger

func (server *Server) GetLedger(w http.ResponseWriter, r *http.Request)

GetLedger Controller @Summary Get ledger @Description Calling the kraken api and get the ledger @ID get-ledger @Accept json @Produce json @Success 200 {object} models.Ledger @Header 200 {string} Token "ok" @Failure 404 {object} http. @Router /ledger [get]

func (*Server) GetTradeBalance

func (server *Server) GetTradeBalance(w http.ResponseWriter, r *http.Request)

GetTradeBalance Controller @Summary Get trade balance @Description Calling the kraken api and get the trade balance @ID get-trade-balance @Accept json @Produce json @Success 200 {object} models.TradeBalance @Header 200 {string} Token "ok" @Failure 404 {object} http. @Router /balance [get]

func (*Server) HealthCheck

func (server *Server) HealthCheck(w http.ResponseWriter, r *http.Request)

HealthCheck checks api health status

func (*Server) Home

func (server *Server) Home(w http.ResponseWriter, r *http.Request)

Home Controller @Summary Get home @Description Homepage @ID home @Accept json @Produce json @Header 200 {string} Token "ok" @Failure 404 {object} utils.HTTPError404 @Router /home [get]

func (*Server) Initialize

func (server *Server) Initialize() error

Initialize is a method @Summary init db connection and set router @Description initialize database connection and set multiplexer router @ID init-db-and-set-router

func (*Server) Run

func (server *Server) Run()

Run calls listen-and-serve and implements tracing and logging handler @Summary Runs the listener on tcp and serves handler for incoming connections @Description run listen and serve on given port @ID run-listen-and-serve-on-give-port

Jump to

Keyboard shortcuts

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