controller

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package controller contains all application controllers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiController

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

ApiController is main API controller of application

func NewApiController

func NewApiController(db *gorm.DB,
	config *model.ApplicationConfig,
	cache *cache.ChainCache,
	registry *provider.Registry) *ApiController

NewApiController is the constructor

func (*ApiController) Historical

func (controller *ApiController) Historical() gin.HandlerFunc

Historical godoc @Summary Get historical currency rates @Produce json @Param provider path string false "Provider" Enums(emirates, fixer) @Param date path string true "Rates date (format YYYY-MM-DD)" @Param base query string true "Base currency" @Param symbols query string true "Quoted currencies, comme separated" @Param force query boolean false "Force do not use any cache" @Success 200 {object} model.SuccessApiResponse @Router /historical/{provider}/{date} [get]

func (*ApiController) Latest

func (controller *ApiController) Latest() gin.HandlerFunc

Latest godoc @Summary Get latest currency rates @Produce json @Param provider path string false "Provider" Enums(emirates, fixer) @Param base query string true "Base currency" @Param symbols query string true "Quoted currencies, comme separated" @Param force query boolean false "Force do not use any cache (except emirates-latest combination)" @Success 200 {object} model.SuccessApiResponse @Router /latest/{provider} [get]

func (*ApiController) Status

func (controller *ApiController) Status() gin.HandlerFunc

Status godoc @Summary Using for microservice health-check by Docker @Produce json @Success 200 {object} model.PingApiResponse @Router /status [get]

Jump to

Keyboard shortcuts

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