views

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func (*Context) PrepareRender added in v0.1.3

func (context *Context) PrepareRender(viewName string) *Renderer

type Manager

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

Manager is singleton manager for view module

func (*Manager) PrepareRender added in v0.1.3

func (manager *Manager) PrepareRender(viewName string) *Renderer

func (*Manager) RegisterView

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

RegisterView used to register view

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 Renderer

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

func (*Renderer) RenderList added in v0.1.3

func (renderer *Renderer) RenderList(list *models.List) interface{}

RenderList used to render list view with options

func (*Renderer) RenderSingle added in v0.1.3

func (renderer *Renderer) RenderSingle(item models.Modellable) interface{}

RenderSingle used to render single item's view with options

func (*Renderer) WithParams added in v0.1.3

func (renderer *Renderer) WithParams(params helpers.H) *Renderer

func (*Renderer) WithRootKey added in v0.1.3

func (renderer *Renderer) WithRootKey(rootKey string) *Renderer

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