route

package
v0.0.0-...-7fa7ca5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResource

func CreateResource(prefix string, router fiber.Router, controller ResourceController, config ...ResourceConfig) fiber.Router

The method to define route group with index, store, show, update, delete routes. Prefix must be singular for properly routing. Permissions are auto-putting. So you should create necessary permissions if you want to use permissions. Permission forms: list-prefix(s) (index), create-prefix (store), show-prefix(s) (show), edit-prefix (update), delete-prefix (destroy).

Types

type ResourceConfig

type ResourceConfig struct {
	WithPermissions bool
	Exclude         []string
}

type ResourceController

type ResourceController interface {
	Index(c *fiber.Ctx) error
	Store(c *fiber.Ctx) error
	Show(c *fiber.Ctx) error
	Update(c *fiber.Ctx) error
	Destroy(c *fiber.Ctx) error
}

Jump to

Keyboard shortcuts

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