views

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Options added in v0.0.71

func Options() *options

Types

type Context added in v0.0.69

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

Context used to represent view rendering context with data

func (*Context) Item added in v0.0.69

func (context *Context) Item() models.Modellable

Item used to retrieve itme in context

func (*Context) Params added in v0.0.69

func (context *Context) Params(key string) interface{}

Params used to retrieve params value

func (*Context) ParamsBool added in v0.0.72

func (context *Context) ParamsBool(key string) bool

ParamsBool used to retrieve params value in bool

func (*Context) ParamsFloat64 added in v0.0.69

func (context *Context) ParamsFloat64(key string, fallback float64) float64

ParamsFloat64 used to retrieve params value in float64

func (*Context) ParamsInt added in v0.0.69

func (context *Context) ParamsInt(key string, fallback int) int

ParamsInt used to retrieve params value in int

func (*Context) ParamsStr added in v0.0.69

func (context *Context) ParamsStr(key string) string

ParamsStr used to retrieve params value in string

type Manager

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

Manager is singleton manager for view module

func (*Manager) RegisterView

func (manager *Manager) RegisterView(viewName string, handler func() Viewable)

RegisterView used to register view

func (*Manager) RenderListView added in v0.0.69

func (manager *Manager) RenderListView(viewName string, list *models.List, options *options) interface{}

RenderListView used to render list view with options

func (*Manager) RenderSingleView added in v0.0.69

func (manager *Manager) RenderSingleView(viewName string, item models.Modellable, options *options) interface{}

RenderSingleView used to render single item's view with options

func (*Manager) RenderView

func (manager *Manager) RenderView(viewName string, params helpers.H) interface{}

RenderView used to render view

func (*Manager) Setup

func (manager *Manager) Setup()

Setup used to setup view manager

type ViewHandler

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

type Viewable

type Viewable interface {
	Render(context *Context) interface{}
}

Viewable is the interface for all views implementing view's functionalities

Jump to

Keyboard shortcuts

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