views

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: GPL-3.0 Imports: 11 Imported by: 2

Documentation

Overview

Package views подготовка вывода данных в поток возврата

Index

Constants

This section is empty.

Variables

View Source
var HEADERS = map[string]string{
	"Content-Type":     "text/html; charset=utf-8",
	"author":           "ruslanBik4",
	"Server":           "HTTPGO/0.9 (CentOS) Go 1.14",
	"Content-Language": "en, ru",
	"Age":              fmt.Sprintf("%f", time.Since(server.GetServerConfig().StartTime).Seconds()),
}

HEADERS - list standard header for html page - noinspection GoInvalidConstType

Functions

func IsAJAXRequest

func IsAJAXRequest(r *fasthttp.Request) bool

IsAJAXRequest - is this AJAX-request

func RenderAnotherSignUpForm

func RenderAnotherSignUpForm(ctx *fasthttp.RequestCtx, placeholder string)

RenderAnotherSignUpForm - new form for registration

func RenderAnyForm

func RenderAnyForm(ctx *fasthttp.RequestCtx, Title string, fields forms.FieldsTable,
	Inputs map[string][]string, head, foot string) error

RenderAnyForm show form for list fields

func RenderAnyJSON

func RenderAnyJSON(w *fasthttp.RequestCtx, arrJSON map[string]interface{})

RenderAnyJSON marshal JSON from arrJSON

func RenderAnyPage

func RenderAnyPage(ctx *fasthttp.RequestCtx, strContent string) error

RenderAnyPage (deprecate) TODO: replace string output by streaming

func RenderAnySlice

func RenderAnySlice(w *fasthttp.RequestCtx, arrJSON []interface{})

RenderAnySlice marshal JSON from slice

func RenderArrayJSON

func RenderArrayJSON(ctx *fasthttp.RequestCtx, arrJSON []map[string]interface{})

RenderArrayJSON marshal JSON from arrJSON

func RenderHTMLPage added in v1.0.10

func RenderHTMLPage(ctx *fasthttp.RequestCtx, fncWrite func(w io.Writer))

RenderOutput render for output script execute

func RenderJSONAnyForm

func RenderJSONAnyForm(w *fasthttp.RequestCtx, fields qb.QBTable, form *json.FormStructure,
	AddJson json.MultiDimension)

RenderJSONAnyForm render JSON for form by fields map

func RenderOutput

func RenderOutput(w *fasthttp.RequestCtx, stdoutStderr []byte)

RenderOutput render for output script execute

func RenderSignForm

func RenderSignForm(ctx *fasthttp.RequestCtx, email string)

RenderSignForm show form for authorization user

func RenderSignUpForm

func RenderSignUpForm(ctx *fasthttp.RequestCtx, placeholder string)

RenderSignUpForm show form registration user

func RenderStringSliceJSON

func RenderStringSliceJSON(w *fasthttp.RequestCtx, arrJSON []string)

RenderStringSliceJSON marshal JSON from slice strings

func RenderTemplate

func RenderTemplate(ctx *fasthttp.RequestCtx, tmplName string, Content interface{}) error

RenderTemplate render from template tmplName

func WriteHeaders

func WriteHeaders(ctx *fasthttp.RequestCtx)

WriteHeaders выдаем стандартные заголовки страницы

func WriteHeadersHTML added in v1.0.10

func WriteHeadersHTML(ctx *fasthttp.RequestCtx)

func WriteJSONHeaders

func WriteJSONHeaders(ctx *fasthttp.RequestCtx)

WriteJSONHeaders return standart headers for JSON

Types

type ParamNotCorrect

type ParamNotCorrect map[string]string

ParamNotCorrect - map bad parameters on this request

Directories

Path Synopsis
Package fonts сервер отдачи шрифтов (пока реализовано только разделение браузеров на два виде, позже планируется учитывать другие параметры пользователя
Package fonts сервер отдачи шрифтов (пока реализовано только разделение браузеров на два виде, позже планируется учитывать другие параметры пользователя
templates
css
forms
генерация форм на основе типов полей таблиц БД
генерация форм на основе типов полей таблиц БД
js
json
формирование JSON из разного вида данных и выдача текста в поток
формирование JSON из разного вида данных и выдача текста в поток

Jump to

Keyboard shortcuts

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