Help us shape the future of Go! Take the 2026 Go Developer Survey

web

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpMethods = HttpMethod{}.New()

HttpMethods is an initialized HttpMethodEnum variable.

View Source
var Protocols = Protocol{}.New()

Protocols is an initialized ProtocolEnum variable.

Functions

This section is empty.

Types

type FuncMapper

type FuncMapper interface {
	FuncMap() template.FuncMap
}

FuncMapper is an interface defining an object that returns a template.FuncMap

type HttpMethod

type HttpMethod = Enum[HttpMethodEnum]

HttpMethod is an Enum aloas for HttpMethodEnum

type HttpMethodEnum

type HttpMethodEnum struct {
	GET,
	HEAD,
	POST,
	PUT,
	PATCH,
	DELETE,
	CONNECT,
	OPTIONS,
	TRACE,
	USE HttpMethod
}

HttpMethodEnum is an Enum struct defining HTTP Methods

type LocaleFuncMap

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

LocaleFuncMap implements FuncMapper and deliver template functions to retrieve translation and localized message.

Functions :

  • "translate": [LocaleMessageBundle.Translate]
  • "cardinal": [LocaleMessageBundle.Cardinal]
  • "ordinal": [LocaleMessageBundle.Ordinal]
  • "ranges": [LocaleMessageBundle.Range]

func (*LocaleFuncMap) FuncMap

func (this *LocaleFuncMap) FuncMap() template.FuncMap

FuncMap() implements FuncMapper

func (LocaleFuncMap) New

func (this LocaleFuncMap) New(contextHolder LocaleContextHolder, messageSource MessageSource) *LocaleFuncMap

New() create a new LocaleFuncMap using a [ThreadLocaleContextHolder] and [MessageSource]

type Protocol

type Protocol = Enum[ProtocolEnum]

Protocol is an Enum alias for ProtocolEnum

type ProtocolEnum

type ProtocolEnum struct {
	HTTP,
	HTTPS,
	GRPC Protocol
}

ProtocolEnum is an Enum struct defining web protocols

type RequestMapping

type RequestMapping interface {
	// contains filtered or unexported methods
}

RequestMapping is a marker interface used to indicate a possible mapping for a [core.Controller] or a [core.Controller] method.

It should contain in a struct tag the following elements :

  • Path : the requested path URI to map to
  • Method : the HttpMethod to map to

NOTE: Rays primary module (this project) does not provide by itself a working core.Controller implementation.

type TemplateFunctionMap

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

TemplateFunctionMap is a container object for template.FuncMap

func (*TemplateFunctionMap) Add

func (this *TemplateFunctionMap) Add(name string, fn any) Error

Add() adds a function "fn" with name "name" to the this TemplateFunctionMap

func (*TemplateFunctionMap) FuncMap

func (this *TemplateFunctionMap) FuncMap() template.FuncMap

FuncMap() returns all the template function loaded as a template.FuncMap

func (*TemplateFunctionMap) Load

func (this *TemplateFunctionMap) Load(fnmap template.FuncMap) Error

Load() will load an already defined template.FuncMap into itself.

func (TemplateFunctionMap) New

New() creates a new TemplateFunctionMap

Jump to

Keyboard shortcuts

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