Documentation ¶
Index ¶
- func DefineFunctions(googleAnalyticsID string) template.FuncMap
- type BondPageModel
- type CollectionItemModel
- type CollectionModel
- type CollectionPageItemModel
- type CollectionPageModel
- type Controller
- func (ctrl *Controller) BondPage(c *gin.Context)
- func (ctrl *Controller) CollectionPage(c *gin.Context)
- func (ctrl *Controller) ErrorPageMiddleware() gin.HandlerFunc
- func (ctrl *Controller) IndexPage(c *gin.Context)
- func (ctrl *Controller) SearchPage(c *gin.Context)
- func (ctrl *Controller) SuggestPage(c *gin.Context)
- type Error
- type ErrorPageModel
- type IndexPageModel
- type SearchPageModel
- type SearchQueryModel
- type SuggestPageCollectionModel
- type SuggestPageModel
- type SuggestPortfolioRequest
- type SuggestPortfolioRequestPart
- type SuggestViewCashFlowPageModel
- type SuggestViewPageModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineFunctions ¶
DefineFunctions создает набор функций для отрисовки представлений
Types ¶
type BondPageModel ¶
BondPageModel - модель для страницы "pages/bond.html"
func NewBondPageModel ¶
NewBondPageModel создает новые объекты типа BondPageModel
type CollectionItemModel ¶
CollectionItemModel - модель элемента коллекции для страницы "pages/index.html"
type CollectionModel ¶
type CollectionModel struct { ID string Name string Duration recommender.Duration Bonds []CollectionItemModel }
CollectionModel - модель коллекции для страницы "pages/index.html"
func NewCollectionModel ¶
func NewCollectionModel(u app.UnitOfWork, collection recommender.Collection) (*CollectionModel, error)
NewCollectionModel создает объекты типа CollectionModel
type CollectionPageItemModel ¶
type CollectionPageItemModel struct { Bond *data.Bond Issuer *data.Issuer Report *recommender.Report }
CollectionPageItemModel - модель отдельной записи в коллекции (для страницы "pages/collection.html")
type CollectionPageModel ¶
type CollectionPageModel struct { ID string Name string ItemsPerDuration map[recommender.Duration][]CollectionPageItemModel }
CollectionPageModel - модель для страницы "pages/collection.html"
func NewCollectionPageModel ¶
func NewCollectionPageModel(app app.App, context context.Context, id string) (*CollectionPageModel, error)
NewCollectionPageModel создает новые объекты типа CollectionPageModel
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller - контроллер веб-страниц
func (*Controller) BondPage ¶
func (ctrl *Controller) BondPage(c *gin.Context)
BondPage обрабатывает запросы "GET /bonds/:id"
func (*Controller) CollectionPage ¶
func (ctrl *Controller) CollectionPage(c *gin.Context)
CollectionPage обрабатывает запросы "GET /collections/:id"
func (*Controller) ErrorPageMiddleware ¶
func (ctrl *Controller) ErrorPageMiddleware() gin.HandlerFunc
ErrorPageMiddleware отвечает за обработку ошибок
func (*Controller) IndexPage ¶
func (ctrl *Controller) IndexPage(c *gin.Context)
IndexPage обрабатывает запросы "GET /"
func (*Controller) SearchPage ¶
func (ctrl *Controller) SearchPage(c *gin.Context)
SearchPage обрабатывает запросы "GET /search"
func (*Controller) SuggestPage ¶
func (ctrl *Controller) SuggestPage(c *gin.Context)
SuggestPage обрабатывает запросы "GET /suggest"
type ErrorPageModel ¶
ErrorPageModel - модель для страницы
type IndexPageModel ¶
type IndexPageModel struct {
Collections []CollectionModel
}
IndexPageModel - модель для страницы "pages/index.html"
func NewIndexPageModel ¶
NewIndexPageModel создает объекты типа IndexPageModel
type SearchPageModel ¶
type SearchPageModel struct { Query string Bonds []*data.Bond Skip int TotalCount int DisplayedCount int }
SearchPageModel - модель для страницы "pages/search.html"
func NewSearchPageModel ¶
func NewSearchPageModel(app app.App, context context.Context, query string, skip int) (*SearchPageModel, error)
NewSearchPageModel создает объекты типа SearchPageModel
type SearchQueryModel ¶
type SearchQueryModel struct { Text string `form:"q"` Skip int `form:"skip"` Partial bool `form:"partial"` }
SearchQueryModel - модель для запроса "GET /search"
type SuggestPageCollectionModel ¶
SuggestPageCollectionModel описывает коллекцию на странице "pages/suggest.html"
type SuggestPageModel ¶
type SuggestPageModel struct {
Collections []SuggestPageCollectionModel
}
SuggestPageModel - модель для страницы "pages/suggest.html"
type SuggestPortfolioRequest ¶
type SuggestPortfolioRequest struct { Amount float64 `json:"amount"` MaxDuration recommender.Duration `json:"-"` MaxDurationRaw int `json:"max_duration"` Parts []*SuggestPortfolioRequestPart `json:"parts"` }
SuggestPortfolioRequest - параметры для запроса GET /api/suggest-portfolio
func NewSuggestPortfolioRequest ¶
func NewSuggestPortfolioRequest(c *gin.Context, u app.UnitOfWork) (*SuggestPortfolioRequest, error)
NewSuggestPortfolioRequest создает объект SuggestPortfolioRequest из строки
func (*SuggestPortfolioRequest) String ¶
func (r *SuggestPortfolioRequest) String() string
String преобразует значение в строку
type SuggestPortfolioRequestPart ¶
type SuggestPortfolioRequestPart struct { Collection recommender.Collection `json:"-"` CollectionName string `json:"-"` CollectionID string `json:"collection"` Weight float64 `json:"weight"` }
SuggestPortfolioRequestPart - элемент параметра запроса GET /api/suggest-portfolio
type SuggestViewCashFlowPageModel ¶
type SuggestViewCashFlowPageModel struct { Date time.Time Amount float64 HasCoupon bool HasAmortization bool HasMaturity bool }
SuggestViewCashFlowPageModel - модель выплаты для страницы "pages/suggest_view.html"
type SuggestViewPageModel ¶
type SuggestViewPageModel struct { SuggestPageModel Request *SuggestPortfolioRequest Portfolio *recommender.SuggestResult CashFlow []*SuggestViewCashFlowPageModel }
SuggestViewPageModel - модель для страницы "pages/suggest_view.html"