webenv

package
v0.1.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: 17 Imported by: 0

Documentation

Overview

You can use the "packr clean" command to clean up this, and any other packr generated files.

Index

Constants

View Source
const (
	//AssetPattern the pattern for the static file rout
	AssetPattern = "/assets"

	//AssetHandlerPattern the pattern for serving asset files thru handler
	AssetHandlerPattern = "/assets/*"

	//AssetRoot the root dir of the static asset files
	AssetRoot = "web/assets"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	Api            bool
	TStore         template.TStore
	Templates      *packr.Box
	Assets         http.FileSystem
	DS             data.Datastore
	Services       *services.Services
	MessageLocator *msg.MessageLocator
	EF             models.EntityFactory
}

Env the environment

func GetApiEnv added in v0.1.3

func GetApiEnv() *Env

GetApiEnv return new initialized environment for serving api

func GetEnv added in v0.1.3

func GetEnv() *Env

func GetWebEnv

func GetWebEnv() *Env

GetWebEnv return new initialized environment

type EnvContext

type EnvContext struct {
	echo.Context
	Env *Env
}

EnvContext extends echo.Context to provide the application environment

func (*EnvContext) FormValueRequired

func (ec *EnvContext) FormValueRequired(formValue string) string

FormValueRequired ...

func (*EnvContext) RequestData

func (ec *EnvContext) RequestData() request.RData

RequestData get RequestData from context

type TData

type TData map[string]interface{}

TData map holding data for page templates

func NewTemplateData

func NewTemplateData() TData

NewTemplateData ...

func NewTemplateDataWithRequestData

func NewTemplateDataWithRequestData(requestData request.RData) TData

NewTemplateDataWithRequestData return view data map filled with context data

Jump to

Keyboard shortcuts

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