goter

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 5 Imported by: 0

README

goter

Router implemented in go. Agnostic of specific ambient context. There is faster, static variant, and dynamic, but slower one.

Documentation

Index

Constants

View Source
const (
	Post    = "POST"
	Get     = "GET"
	Put     = "PUT"
	Patch   = "PATCH"
	Delete  = "DELETE"
	Options = "OPTIONS"
	Connect = "CONNECT"
	Head    = "HEAD"
	Trace   = "TRACE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IParams

type IParams interface {
	Path(param string) string
	Query(param string) string
}

type IRoute

type IRoute[H any] interface {
	Post(H) IRoute[H]
	Get(H) IRoute[H]
	Put(H) IRoute[H]
	Patch(H) IRoute[H]
	Delete(H) IRoute[H]
	Options(H) IRoute[H]
	Connect(H) IRoute[H]
	Head(H) IRoute[H]
	Trace(H) IRoute[H]
}

type IRouter

type IRouter[H any] interface {
	Route(path string) IRoute[H]
	Select(path string, query string, method string) (H, IParams)
}

func CreateRouter

func CreateRouter[H any]() IRouter[H]

type IStatRouter

type IStatRouter[H any] interface {
	Route(path string) IRoute[H]
	Select(path string, method string) H
}

func CreateStaticRouter

func CreateStaticRouter[H any]() IStatRouter[H]

Jump to

Keyboard shortcuts

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