router

package
v1.0.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

View Source
var (
	EVENT_SET_ROUTER    = "event:set:router"
	EVENT_REMOVE_ROUTER = "event:remove:router"
	EVENT_RESET_ROUTER  = "event:reset:router"
)

Functions

func GetChanels added in v0.1.12

func GetChanels() et.Json

* * GetChannels * @return et.Json *

func GetRoutes

func GetRoutes() map[string]et.Json

* * GetRoutes * @return map[string]et.Json *

func HttpDelete added in v1.0.11

func HttpDelete(w http.ResponseWriter, r *http.Request)

* * HttpDelete handles DELETE requests to delete solver data * @param w http.ResponseWriter, r *http.Request *

func HttpGet added in v1.0.11

func HttpGet(w http.ResponseWriter, r *http.Request)

* * HttpGet handles GET requests to get solver data * @param w http.ResponseWriter, r *http.Request *

func HttpSet added in v1.0.11

func HttpSet(w http.ResponseWriter, r *http.Request)

* * HttpSet handles POST requests to set solver data * @param w http.ResponseWriter, r *http.Request *

func OnDelete added in v1.0.11

func OnDelete(f DeleteFn)

* * OnDelete * @params f DeleteFn *

func OnGet added in v1.0.11

func OnGet(f GetFn)

* * OnGet * @params f GetFn *

func OnSet added in v1.0.11

func OnSet(f SetFn)

* * OnSet * @params f SetFn *

func Private added in v0.1.1

func Private(r *chi.Mux, method, path string, h http.HandlerFunc, packageName, packagePath, host string) *chi.Mux

* * Private * @param r *chi.Mux, method string, path string, h http.HandlerFunc, packageName string, packagePath string, host string * @return *chi.Mux *

func Protect

func Protect(r *chi.Mux, method, path string, h http.HandlerFunc, packageName, packagePath, host string) *chi.Mux

* * Protect * @param r *chi.Mux, method string, path string, h http.HandlerFunc, packageName string, packagePath string, host string * @return *chi.Mux *

func Public

func Public(r *chi.Mux, method, path string, h http.HandlerFunc, packageName, packagePath, host string) *chi.Mux

* * Public * @param r *chi.Mux, method string, path string, h http.HandlerFunc, packageName string, packagePath string, host string * @return *chi.Mux *

func PushApiGateway

func PushApiGateway(method, path, resolve string, tpHeader TpHeader, header et.Json, excludeHeader []string, version int, packageName string)

* * PushApiGateway * @param method, path, resolve string, header et.Json, tpHeader TpHeader, excludeHeader []string, version int, packageName string *

func RemoveApiGateway added in v0.1.17

func RemoveApiGateway(id string)

* * RemoveApiGateway * @param id string *

func SetAutentication added in v1.0.12

func SetAutentication(fn func(http.Handler) http.Handler)

* * SetAutentication * @param fn func(http.Handler) http.Handler *

func SetChannels added in v0.1.12

func SetChannels(channels *Channels)

* * SetChannels * @param vars et.Json *

func With

func With(r *chi.Mux, method, path string, middlewares []func(http.Handler) http.Handler, h http.HandlerFunc, packageName, packagePath, host string) *chi.Mux

* * With * @param r *chi.Mux, method string, path string, middlewares []func(http.Handler) http.Handler, h http.HandlerFunc, packageName string, packagePath string, host string * @return *chi.Mux *

Types

type Channels added in v0.1.17

type Channels struct {
	EVENT_SET_ROUTER    string
	EVENT_REMOVE_ROUTER string
	EVENT_RESET_ROUTER  string
}

type DeleteFn added in v1.0.11

type DeleteFn func(id string) error

type GetFn added in v1.0.11

type GetFn func(id string) (et.Json, error)

type Routes

type Routes struct {
	Name   string
	Routes map[string]et.Json
}

type SetFn added in v1.0.11

type SetFn func(id string, data et.Json) error

type TpHeader

type TpHeader int
const (
	TpKeepHeader TpHeader = iota
	TpJoinHeader
	TpReplaceHeader
)

func IntToTpHeader

func IntToTpHeader(tp int) TpHeader

* * IntToTpHeader * @param tp int * @return TpHeader *

func ToTpHeader

func ToTpHeader(tp int) TpHeader

* * ToTpHeader * @param str string * @return TpHeader *

func (TpHeader) String

func (t TpHeader) String() string

* * String * @return string *

Jump to

Keyboard shortcuts

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