router

package
v0.5.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURIParams

func GetURIParams(api *router.API, rawURL url.URL) url.Values

GetURIParams returns the values retrieved from the rawURL

func IsWildCardBackendPath

func IsWildCardBackendPath(api *router.API) bool

IsWildCardBackendPath checks whether the configured path of the upstream restful service contains parameters

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node defines the single method of the router configured API

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route defines the tree of router APIs

func NewRoute

func NewRoute() *Route

NewRoute returns an empty router tree

func (*Route) ClearAPI

func (rt *Route) ClearAPI() error

ClearAPI clear the api

func (*Route) DeleteAPI

func (rt *Route) DeleteAPI(fullPath string, httpverb config.HTTPVerb) bool

DeleteAPI delete api by fullPath and http verb

func (*Route) DeleteNode

func (rt *Route) DeleteNode(fullPath string) bool

DeleteNode delete node by fullPath

func (*Route) FindAPI

func (rt *Route) FindAPI(fullPath string, httpverb config.HTTPVerb) (*router.API, bool)

FindAPI return if api has path in trie,or nil

func (*Route) MatchAPI

func (rt *Route) MatchAPI(fullPath string, httpverb config.HTTPVerb) (*router.API, bool)

MatchAPI FindAPI returns the api that meets the rule

func (*Route) PutAPI

func (rt *Route) PutAPI(api router.API) error

PutAPI puts an api into the resource

func (*Route) PutOrUpdateAPI

func (rt *Route) PutOrUpdateAPI(api router.API) error

PutOrUpdateAPI puts or updates an api into the resource

func (*Route) RemoveAPI

func (rt *Route) RemoveAPI(api router.API)

Jump to

Keyboard shortcuts

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