route

package
v0.0.0-...-b05e202 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllApiRoutes

func AllApiRoutes() map[RouteType]Route

AllApiRoutes returns a map containing all default routes and batch operation routes.

func BatchOperations

func BatchOperations() map[RouteType]Route

BatchOperations returns a map of batch operation routes (BatchDelete, BatchPut, BatchPatch, BatchPost, BatchGet).

func DefaultApiRoutes

func DefaultApiRoutes() map[RouteType]Route

DefaultApiRoutes returns a map of default CRUD routes (Get, GetList, Post, Put, Patch, Delete, Head, Options) with empty configurations.

Types

type Route

type Route struct {
	RouteType     RouteType
	Configuration map[configuration.ConfigurationType]configuration.Configuration
}

Route is a struct that represents a route it use a type RouteType to define the type of route (Get, Post, Put, etc) and a map of configuration.Configuration to store the configurations of the route

func NewRoute

func NewRoute(routeType RouteType, configurations ...configuration.Configuration) Route

NewRoute creates a new Route with the specified route type and optional configurations.

type RouteType

type RouteType int8

RouteType represents the type of HTTP route operation.

const (
	Undefined RouteType = iota
	//CRUD
	GetList
	Get
	Post
	Put
	Delete
	Patch

	//useless stuff
	Options
	Connect
	Trace
	Head

	//batch operations
	BatchGet
	BatchPost
	BatchPut
	BatchPatch
	BatchDelete
)

func (RouteType) String

func (e RouteType) String() string

String returns the HTTP method name for the RouteType.

Jump to

Keyboard shortcuts

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