http

package
v0.3.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MethodGet     = "GET"     // RFC 7231, 4.3.1
	MethodHead    = "HEAD"    // RFC 7231, 4.3.2
	MethodPost    = "POST"    // RFC 7231, 4.3.3
	MethodPut     = "PUT"     // RFC 7231, 4.3.4
	MethodPatch   = "PATCH"   // RFC 5789
	MethodDelete  = "DELETE"  // RFC 7231, 4.3.5
	MethodConnect = "CONNECT" // RFC 7231, 4.3.6
	MethodOptions = "OPTIONS" // RFC 7231, 4.3.7
	MethodTrace   = "TRACE"   // RFC 7231, 4.3.8

)

Http Methods

Variables

This section is empty.

Functions

func AddBulkHttpGroups

func AddBulkHttpGroups(httpGroups []HttpGroup) error

AddBulkHttpGroups - add bulk http groups to the server

func AddBulkHttpRoutes

func AddBulkHttpRoutes(httpRoutes []HttpRoute) error

AddBulkHttpRoutes - add bulk http routes to the server

func AddHttpGroup

func AddHttpGroup(groupName string, f func(c *gin.Context), groups []string, serverName ...string) error

AddHttpGroup - Add group by parameters

func AddHttpGroupByObj

func AddHttpGroupByObj(group HttpGroup) error

AddHttpGroupByObj - add group by HttpGroup obj

func AddHttpRoute

func AddHttpRoute(method string, path string, f func(c *gin.Context), routeName string, versions []string, groupNames []string, serverName ...string) error

AddHttpRoute - Add route by parameters

func AddHttpRouteByObj

func AddHttpRouteByObj(httpRoute HttpRoute) error

AddHttpRouteByObj - add route by HttpRoute obj

func AttachHttpErrorHandler

func AttachHttpErrorHandler(f func(ctx *gin.Context, err any), serverNames ...string) error

AttachHttpErrorHandler - Attach http error handler to the manager

func PrintAllRoutes

func PrintAllRoutes()

PrintAllRoutes - Print all routes on the screen

Types

type HttpGroup

type HttpGroup struct {
	GroupName string
	F         func(c *gin.Context)
	Groups    []string
	Servers   []string
}

HttpGroup - Structure of the group

type HttpRoute

type HttpRoute struct {
	Method     string
	Path       string
	RouteName  string
	Versions   []string
	GroupNames []string
	F          func(c *gin.Context)
	Servers    []string
}

HttpRoute - Structure of the route

Jump to

Keyboard shortcuts

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