router

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 12 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"
)
View Source
const (
	APIGATEWAY_SET    = "apigateway/set/resolve"
	APIGATEWAY_DELETE = "apigateway/delete/resolve"
	APIGATEWAY_RESET  = "apigateway/reset"
)

Variables

This section is empty.

Functions

func Authorization

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

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

func DeleteApiGatewayById

func DeleteApiGatewayById(id, method, path string)

* * DeleteApiGatewayById * @param id, method, path string *

func GetRoutes

func GetRoutes() map[string]et.Json

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

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(id, method, path, resolve string, header et.Json, tpHeader TpHeader, excludeHeader []string, private bool, packageName string)

* * PushApiGateway * @param id, method, path, resolve string, header et.Json, tpHeader TpHeader, excludeHeader []string, private bool, packageName string *

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 Routes

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

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 *

type TypeRoute

type TypeRoute int
const (
	HTTP TypeRoute = iota
	REST
)

Jump to

Keyboard shortcuts

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