urls

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package urls containing list of struct Url[method, path, handler, name] for routing

Index

Constants

This section is empty.

Variables

View Source
var AdminPatterns = []*Url{
	&Url{"Get", "/admin", admin.IndexPage, "admin", "Админ"},
}
View Source
var UrlPatterns = []*Url{
	&Url{"Get", "/", functions.IndexPage, "index", ""},

	&Url{"All", "/login", auth.LoginPage, "auth-login", ""},
	&Url{"All", "/logout", auth.APILogout, "api-auth-logout", ""},
	&Url{"POST", "/new_password", auth.APINewPassword, "api-auth-new-password", ""},
	&Url{"POST", "/registration", auth.APIRegistration, "api-auth-registration", ""},

	&Url{"Get", "/admin", admin.IndexPage, "admin", "Админ"},
}

Functions

func AddAdminPatterns

func AddAdminPatterns(ap []*Url)

func AddUrlPatterns

func AddUrlPatterns(up []*Url)

Types

type Url

type Url struct {
	Method      string
	Path        string
	Handler     func(*db.DB, ...interface{}) fiber.Handler
	Name        string
	DisplayName string
}

func GetUrl

func GetUrl(name string) *Url

func GetUrlOfPath

func GetUrlOfPath(path string) *Url

Jump to

Keyboard shortcuts

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