serverapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PDRedirectorHeader    = "PD-Redirector"
	PDAllowFollowerHandle = "PD-Allow-follower-handle"
)

HTTP headers.

Variables

This section is empty.

Functions

func IsServiceAllowed

func IsServiceAllowed(s *server.Server, group apiutil.APIServiceGroup) bool

IsServiceAllowed checks the service through the path.

func NewRedirector

func NewRedirector(s *server.Server, opts ...RedirectorOption) negroni.Handler

NewRedirector redirects request to the leader if needs to be handled in the leader.

func NewRuntimeServiceValidator

func NewRuntimeServiceValidator(s *server.Server, group apiutil.APIServiceGroup) negroni.Handler

NewRuntimeServiceValidator checks if the path is invalid.

Types

type RedirectorOption

type RedirectorOption func(*redirector)

RedirectorOption defines the option of redirector

func MicroserviceRedirectRule

func MicroserviceRedirectRule(matchPath, targetPath, targetServiceName string) RedirectorOption

MicroserviceRedirectRule new a microservice redirect rule option

Jump to

Keyboard shortcuts

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