views

package
v1.2.167 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Overview

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

Index

Constants

View Source
const AgeOfServer = "AGE"
View Source
const ServerName = "name of server httpgo"

Variables

View Source
var HEADERS = map[string]string{
	"author":           "ruslanBik4",
	"Server":           ServerName,
	"Content-Language": "en,uk",
}

HEADERS - list standard header for html page - noinspection GoInvalidConstType

Functions

func Download added in v1.2.130

func Download(ctx *fasthttp.RequestCtx, fHeader *multipart.FileHeader) error

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 RenderAnyPage

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

RenderAnyPage (deprecate) TODO: replace string output by streaming

func RenderHTMLPage added in v1.0.10

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

RenderHTMLPage render for output script execute

func RenderOutWithWrapLine added in v1.0.11512

func RenderOutWithWrapLine(ctx *fasthttp.RequestCtx, out []byte) error

func RenderOutput

func RenderOutput(ctx *fasthttp.RequestCtx, stdoutStderr []byte, err error) error

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 RenderTemplate

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

RenderTemplate render from template tmplName

func ReplaceWrapLines added in v1.2.15

func ReplaceWrapLines(out []byte) []byte

func WriteCORSHeaders added in v1.2.161

func WriteCORSHeaders(ctx *fasthttp.RequestCtx)

func WriteDownloadHeaders added in v1.2.130

func WriteDownloadHeaders(ctx *fasthttp.RequestCtx, lastModify time.Time, fileName string, length int)

func WriteHeaders

func WriteHeaders(ctx *fasthttp.RequestCtx)

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

func WriteHeadersHTML added in v1.0.10

func WriteHeadersHTML(ctx *fasthttp.RequestCtx)

func WriteJSON added in v1.2.130

func WriteJSON(ctx *fasthttp.RequestCtx, r any) (err error)

WriteJSON write JSON to response

func WriteJSONHeaders

func WriteJSONHeaders(ctx *fasthttp.RequestCtx)

WriteJSONHeaders return standart headers for JSON

func WriteResponse added in v1.2.130

func WriteResponse(ctx *fasthttp.RequestCtx, resp any) error

WriteResponse to ctx body according to type of resp

func WriteServerEventsHeaders added in v1.2.161

func WriteServerEventsHeaders(ctx *fasthttp.RequestCtx)

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
* Copyright (c) 2023-2024.
* Copyright (c) 2023-2024.
json
Package json формирование JSON из разного вида данных и выдача текста в поток
Package json формирование JSON из разного вида данных и выдача текста в поток

Jump to

Keyboard shortcuts

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