router

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	URLPattern    string `json:"urlPattern" yaml:"urlPattern"`
	config.Method `json:"method,inline" yaml:"method,inline"`
	Headers       map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}

API describes the minimum configuration of an RESTful api configure in gateway

func (*API) GetURIParams

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

GetURIParams returns the values retrieved from the rawURL

func (*API) IsWildCardBackendPath

func (api *API) IsWildCardBackendPath() bool

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

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) FindAPI

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

FindAPI returns the api that meets the

func (*Route) PutAPI

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

PutAPI puts an api into the resource

func (*Route) UpdateAPI

func (rt *Route) UpdateAPI(api API) error

UpdateAPI update the api method in the existing router node

Jump to

Keyboard shortcuts

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