hypergon

package module
v0.0.0-...-ed79b10 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 6 Imported by: 0

README

Hypergon

A simplistic web framework built on top Go programming language.

Features

  • Routing
  • Middlewares
  • HTML and JSON Renderer
  • Plugins

Authors

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapter

func Adapter(h HandlerFunc) http.Handler

This will convert the Hyper HandlerFunc to native handler.

Types

type HandlerFunc

type HandlerFunc func(http.ResponseWriter, *http.Request) HypergonError

HandlerFunc is a custom http handler that can return an error

func AdapterHandler

func AdapterHandler(h http.Handler) HandlerFunc

Adapter for handling native implementation of standard handlers for Hyper.

func (HandlerFunc) ServeHTTP

func (h HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Hyper

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

Hyper act as a custom web router multiplexer that utilizes the standard library.

func New

func New() *Hyper

func (*Hyper) Action

func (hy *Hyper) Action(pattern string, handler HandlerFunc)

The implemetation of custom http handler

func (*Hyper) Chain

func (hy *Hyper) Chain(middlewares ...Middleware)

func (*Hyper) Group

func (hy *Hyper) Group(prefix string) *Hyper

func (*Hyper) Shutdown

func (hy *Hyper) Shutdown(ctx context.Context) error

func (*Hyper) Start

func (hy *Hyper) Start(address string) error

Start the server

Accepts adn address eg. `:8000`

func (*Hyper) Use

func (hy *Hyper) Use(m Middleware)

Use method will accept a middleware.

type HypergonError

type HypergonError interface {
	Error() string
	StatusCode() int
}

Custom http error type

func HttpError

func HttpError(status int, message string) HypergonError

type Middleware

type Middleware func(HandlerFunc) HandlerFunc

Middleware func type for easy middleware typing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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