app

package
v0.0.0-...-e09fbcc Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func (*App) HaveValidSessionCookie

func (a *App) HaveValidSessionCookie(r *http.Request) (cache.ActiveSession, bool)

func (*App) InitializeBlacklist

func (a *App) InitializeBlacklist()

func (*App) InitializeCacheManager

func (a *App) InitializeCacheManager()

func (*App) Middleware

func (a *App) Middleware(endPoint http.Handler) http.Handler

Validate session

func (*App) NeedSessionCookie

func (a *App) NeedSessionCookie(r *http.Request) bool

Helper function to check if login should be verified for a given request URL

func (*App) StartApp

func (a *App) StartApp()

StartApp initializes the application (called by main).

func (*App) TestRoute

func (a *App) TestRoute(recorder *httptest.ResponseRecorder, request *http.Request)

func (*App) UpdateSession

func (a *App) UpdateSession(r *http.Request)

type CartItem

type CartItem struct {
	Product products `json:"product"`
	Count   int      `json:"count,omitempty"`
}

type Data

type Data struct {
	User         db.User       //to display individual user
	Merchant     db.Merchant   //to display individual merchant profile to himself logged in merchant
	MerchantShop db.Merchant   //display individual merchant shop to consumers public page
	Merchants    []db.Merchant //to display all the merchants
	Error        Error         //to display an error message IF there is an error msg
	Products     []db.Product  //to display featured items
	Cart         cache.Cart    //to display checkout cart
}

type Error

type Error struct {
	ErrMsg string
}

type Response

type Response struct {
	Redirect bool `json:"redirect"`
}

Jump to

Keyboard shortcuts

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