urlrule

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package urlrule impelments match rule for HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URLRule

type URLRule struct {
	Methods   []string                 `json:"methods,omitempty" jsonschema:"uniqueItems=true,format=httpmethod-array"`
	URL       stringtool.StringMatcher `json:"url" jsonschema:"required"`
	PolicyRef string                   `json:"policyRef,omitempty"`
	// contains filtered or unexported fields
}

URLRule defines the match rule of a http request

func (*URLRule) DeepEqual

func (r *URLRule) DeepEqual(r1 *URLRule) bool

DeepEqual returns true if r deep equal with r1 and false otherwise

func (*URLRule) ID

func (r *URLRule) ID() string

ID returns the ID of the URLRule. ID is the first valid one of Exact, Prefix, RegEx.

func (*URLRule) Init

func (r *URLRule) Init()

Init initialize an URLRule

func (*URLRule) Match

func (r *URLRule) Match(req *http.Request) bool

Match matches a URL to the rule

Jump to

Keyboard shortcuts

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