routes

package
v0.0.0-...-896db50 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MuxRouter *mux.Router

MuxRouter is the gorilla mux router initialized here for Arkeogis

View Source
var Routes []*Route = []*Route{}

All routes added here are stored there. This is usefull for building REST doc

Functions

func Errors

func Errors(w http.ResponseWriter, errors []sanitizer.FieldError)

func FieldError

func FieldError(w http.ResponseWriter, fieldpath string, fieldname string, errorstring string)

func LoadSessionFromRequest

func LoadSessionFromRequest(tx *sqlx.Tx, r *http.Request) *session.Session

func Register

func Register(myroute *Route) error

Register a new Arkeogis route

func RegisterMultiple

func RegisterMultiple(routes []*Route) error

RegisterMultiple will register multiple Arkeogis Routes

func ServerError

func ServerError(w http.ResponseWriter, code int, message string)

Types

type File

type File struct {
	Name    string
	Content []byte
}

type Proute

type Proute struct {
	Json    interface{}
	Params  interface{}
	Session *session.Session
	Lang1   model.Lang
	Lang2   model.Lang
}

type Route

type Route struct {
	Path        string
	Description string // for rest doc generator
	Func        func(rw http.ResponseWriter, r *http.Request, proute Proute)
	Method      string
	Queries     []string
	Json        reflect.Type
	Params      reflect.Type
	Permissions []string
}

Route structure that is used for registering a new Arkeogis Route

Jump to

Keyboard shortcuts

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