pathmatcher

package
v0.0.0-...-719b004 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeSet

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

func (*ChangeSet) AddRoute

func (cs *ChangeSet) AddRoute(method, path string)

func (*ChangeSet) Commit

func (cs *ChangeSet) Commit()

func (*ChangeSet) RemoveAll

func (cs *ChangeSet) RemoveAll()

func (*ChangeSet) RemoveRoute

func (cs *ChangeSet) RemoveRoute(method, path string)

type Matcher

type Matcher interface {
	LookupRoute(method, pathWithParams string) *PathMatched
}

Matcher defines the interface to lookup a a path

type PathMatched

type PathMatched struct {
	Method      string
	OpenAPIPath string
	RouterPath  string
	RedisKey    string
}

PathMatcher holds the information of a matched path in different formats

func NewPathMatched

func NewPathMatched(method, openApiPath string) *PathMatched

type PathMatcher

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

func NewPathMatcher

func NewPathMatcher() *PathMatcher

func (*PathMatcher) AddRoute

func (pm *PathMatcher) AddRoute(method, path string)

func (*PathMatcher) Build

func (pm *PathMatcher) Build()

func (*PathMatcher) LookupRoute

func (pm *PathMatcher) LookupRoute(method, pathWithParams string) *PathMatched

type SharedPathMatcher

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

func NewSharedPathMatcher

func NewSharedPathMatcher(matcher *PathMatcher) *SharedPathMatcher

func (*SharedPathMatcher) LookupRoute

func (spm *SharedPathMatcher) LookupRoute(method, pathWithParams string) *PathMatched

func (*SharedPathMatcher) StartChangeSet

func (spm *SharedPathMatcher) StartChangeSet() *ChangeSet

Jump to

Keyboard shortcuts

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