server

package
v0.0.0-...-10bc8b7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToMap

func ConvertToMap(data interface{}) map[string]interface{}

func FromDuration

func FromDuration(d time.Duration) string

FromDuration returns a friendly string representing an approximation of the given duration

func GetStatic

func GetStatic(c echo.Context) error

func Start

func Start(serverAddress string)

Start server

Types

type CustomValidator

type CustomValidator struct {
	Validator *validator.Validate
}

CustomValidator payload validation

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

Validate payload

type GeneralPayload

type GeneralPayload struct {
	Payload       interface{}
	Authenticated string
	Nick          string
	Template      string
	TemplateID    string
	ServerURL     string
}

GeneralPayload structure to extend any payload

type TemplateRenderer

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

TemplateRenderer is a custom html/template renderer for Echo framework

func CreateTemplateRenderer

func CreateTemplateRenderer() *TemplateRenderer

CreateTemplateRenderer return a renderer with all the templates views

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render renders a template document

Jump to

Keyboard shortcuts

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