gemini

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Conn net.Conn
	URL  *url.URL
	Keys map[string]interface{}
	Lang string
}

func (*Context) Render

func (c *Context) Render(code int, body string)

type Engine

type Engine struct {
	Cert            tls.Certificate
	RouterMap       map[string]HandlerFunc
	DefaultLang     string
	AutoRedirect    bool
	AutoRedirectUrl string
}

func New

func New(certFile, keyFile, DefaultLang string) (engine *Engine, err error)

func (*Engine) Handle

func (e *Engine) Handle(router string, f HandlerFunc)

func (*Engine) HandleDir

func (e *Engine) HandleDir(router string, dirPath string, Index string)

func (*Engine) HandleFile

func (e *Engine) HandleFile(router string, filePath string)

func (*Engine) HandleProxy

func (e *Engine) HandleProxy(router string, url string)

func (*Engine) Run

func (e *Engine) Run(addr string) (err error)

func (*Engine) ServeGemini

func (e *Engine) ServeGemini(conn net.Conn)

type HandlerFunc

type HandlerFunc func(*Context)

Jump to

Keyboard shortcuts

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