route

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

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

Go to latest
Published: Oct 10, 2023 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteSchema

type DeleteSchema struct {
	Route   string   `json:"route"`
	Methods []string `json:"methods"`
}

DeleteSchema struct to represent a new route

type Method

type Method map[string][]MethodValue

Method contains a method and a list of MethodValue for multiple matching for the same route

type MethodValue

type MethodValue struct {
	// Matching variables
	Headers    map[string]string
	Parameters map[string]string
	// Response value
	ResponseCode    int
	Response        any
	ResponseHeaders map[string]string
}

MethodValue stores the matching rules and payload for an specific method

type RegisterSchema

type RegisterSchema struct {
	Route           string            `json:"route"`
	Methods         []string          `json:"methods"`
	Headers         map[string]string `json:"headers"`
	Parameters      map[string]string `json:"parameters"`
	Response        any               `json:"response"`
	ResponseCode    int               `json:"response_code,default=200"`
	ResponseHeaders map[string]string `json:"response_headers"`
}

RegisterSchema struct to represent a new route

type Route

type Route map[string]Method

Route contains the route to be matched and a list of MethodValue for multiple matching for the same route

Jump to

Keyboard shortcuts

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