layout

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Author: James Mallon <jamesmallondev@gmail.com> layout package -

Author: James Mallon <jamesmallondev@gmail.com> layout package -

Author: James Mallon <jamesmallondev@gmail.com> layout package - package offers functions to deal with templates and layouts

Author: James Mallon <jamesmallondev@gmail.com> layout package -

Index

Constants

This section is empty.

Variables

View Source
var PageData map[string]interface{}

Functions

This section is empty.

Types

type FlashMessenger

type FlashMessenger struct{}

Struct type flashMessenger -

func (*FlashMessenger) Get

func (this *FlashMessenger) Get(w http.ResponseWriter, r *http.Request) (flshMsg *map[string]string)

Get method - it prints the message stored in the cookie

func (*FlashMessenger) Set

func (this *FlashMessenger) Set(w *http.ResponseWriter, msg map[string]string)

Set function - it creates the cookie and set the flash message

type FormValidator

type FormValidator struct {
	Rules    map[string]string
	Messages map[string]string
}

Struct type FormHelper -

func (*FormValidator) ErrString

func (this *FormValidator) ErrString(es []error) (emsg string)

CheckErrors method -

func (*FormValidator) Filter

func (this *FormValidator) Filter(r *http.Request) (e []error)

FilterEmail method -

type LayoutManager

type LayoutManager struct {
	ViewFuncProvider
	// contains filtered or unexported fields
}

Struct type layoutHelper - offer DRY solutions to common controllers actions

func (*LayoutManager) Render

func (this *LayoutManager) Render(w http.ResponseWriter, r *http.Request, pageData map[string]interface{}, views ...string)

Render method -

type ViewFuncProvider

type ViewFuncProvider struct{}

Struct type ViewFuncProvider -

func (*ViewFuncProvider) Flash

func (this *ViewFuncProvider) Flash(msg ...interface{}) (flash template.HTML)

Flash method - method receives a non obligatory param in form of a variadic to supress errors of layout requirements, converts the value into a map again and print the message accordingly with the website sample layout

func (*ViewFuncProvider) FormatDate

func (this *ViewFuncProvider) FormatDate(t time.Time) string

FormatDate method - format a date

func (*ViewFuncProvider) ToLower

func (this *ViewFuncProvider) ToLower(text string) string

ToLower method -

func (*ViewFuncProvider) ToUpper

func (this *ViewFuncProvider) ToUpper(text string) string

ToUpper method -

func (*ViewFuncProvider) UCFirst

func (this *ViewFuncProvider) UCFirst(text string) string

UCFirst method -

Jump to

Keyboard shortcuts

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