controller

package
v0.0.0-...-6f8c8e2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormView

type FormView struct {
	Product   *domain.Product
	Structure []form.RatingFormField
	IsValid   bool
}

FormView is the data object for templates with the rating form

type HomeController

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

HomeController provides the start page

func (*HomeController) Home

func (c *HomeController) Home(ctx context.Context, _ *web.Request) web.Result

Home provides the general overview

func (*HomeController) Inject

func (c *HomeController) Inject(
	r *web.Responder,
	ratingRepository domain.RatingRepository,
	productRepository domain.ProductRepository,
)

Inject the dependencies

func (*HomeController) ProductList

func (c *HomeController) ProductList(ctx context.Context, _ *web.Request) web.Result

ProductList shows a list of all products with links to their review overview pages

type RatingController

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

RatingController provides the rating related actions

func (*RatingController) Form

Form shows the rating form

func (*RatingController) FormPost

func (c *RatingController) FormPost(ctx context.Context, r *web.Request) web.Result

FormPost receives the form data and saves the entity

func (*RatingController) Inject

func (c *RatingController) Inject(
	r *web.Responder,
	ratingRepository domain.RatingRepository,
	productRepository domain.ProductRepository,
	formHandlerFactory application.FormHandlerFactory,
	ratingFormDataProvider *form.RatingFormDataProvider,
) *RatingController

Inject dependencies

func (*RatingController) ProductForm

func (c *RatingController) ProductForm(ctx context.Context, r *web.Request) web.Result

ProductForm shows the product selection form

func (*RatingController) Success

func (c *RatingController) Success(ctx context.Context, _ *web.Request) web.Result

Success shows the rating form success page

func (*RatingController) View

View shows the ratings for a specific product

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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