hibiscus

package
v0.0.0-...-d36ff20 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APPLICATION_GRPC_PROTO = "application/grpc+proto"
	APPLICATION_XML        = "application/xml"
	APPLICATION_JSON       = "application/json"
	TEXT_XML               = "text/xml"
	TEXT_PLAIN_UTF8        = "text/plain; charset=utf-8"
	TEXT_HTML_UTF8         = "text/html; charset=utf-8"

	JWT_ISSUER = "palm.atropa"
	JWT_BEARER = "Bearer "

	HTTP_CONTENT_TYPE_HEADER  = "Content-Type"
	HTTP_FORWARDED_FOR_HEADER = "X-Forwarded-For"
	HTTP_AUTHORIZATION_HEADER = "Authorization"
	HTTP_COOKIE_HEADER        = "Cookie"

	GRPC_AUTHORIZATION_HEADER   = "authorization"
	GRPC_ACCEPT_LANGUAGE_HEADER = "accept-language"
	GRPC_X_FORWARDED_FOR_HEADER = "x-forwarded-for"
)

https://www.iana.org/assignments/media-types/media-types.xhtml https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types

Variables

This section is empty.

Functions

func EncodeForm

func EncodeForm(form interface{}) (url.Values, error)

func LoadTemplates

func LoadTemplates(node *embed.FS, theme string) error

func SetSessionKey

func SetSessionKey(secret string) error

func Static

func Static(router *mux.Router, path string, dir string)

func StaticFS

func StaticFS(router *mux.Router, path string, fs embed.FS)

func Wrap

Types

type Context

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

func (*Context) Abort

func (p *Context) Abort(status int, err error)

func (*Context) Data

func (p *Context) Data(status int, content_type string, body []byte)

func (*Context) GetSession

func (p *Context) GetSession(name string) (*sessions.Session, error)

func (*Context) HTML

func (p *Context) HTML(status int, name string, data any)

func (*Context) JSON

func (p *Context) JSON(status int, value any)

func (*Context) ParseForm

func (p *Context) ParseForm(form interface{}) error

func (*Context) SaveSession

func (p *Context) SaveSession(session *sessions.Session) error

func (*Context) String

func (p *Context) String(status int, body string)

func (*Context) Vars

func (p *Context) Vars() map[string]string

func (*Context) XML

func (p *Context) XML(status int, value any)

type H

type H = map[string]interface{}

type HandlerFunc

type HandlerFunc = func(c *Context)

Jump to

Keyboard shortcuts

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