inbound

package
Version: v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APILockConfig

type APILockConfig struct {
	ReadAPIs  []string `yaml:"read_apis"`
	WriteAPIs []string `yaml:"write_apis"`
}

APILockConfig specifies which APIs are Read/Write

type APILockInboundMiddleware

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

APILockInboundMiddleware implements Read/Write lock on API

func NewAPILockInboundMiddleware

func NewAPILockInboundMiddleware(config *APILockConfig) *APILockInboundMiddleware

NewAPILockInboundMiddleware creates new APILockInboundMiddleware

func (*APILockInboundMiddleware) Handle

Handle checks if a request is blocked due to lock down and invokes the underlying handler

func (*APILockInboundMiddleware) HandleOneway

HandleOneway checks if a request is blocked due to lock down and invokes the underlying handler

func (*APILockInboundMiddleware) HandleStream

HandleStream checks if a request is blocked due to lock down and invokes the underlying handler

func (APILockInboundMiddleware) LockRead

func (l APILockInboundMiddleware) LockRead()

func (APILockInboundMiddleware) LockWrite

func (l APILockInboundMiddleware) LockWrite()

func (APILockInboundMiddleware) UnlockRead

func (l APILockInboundMiddleware) UnlockRead()

func (APILockInboundMiddleware) UnlockWrite

func (l APILockInboundMiddleware) UnlockWrite()

type APILockInterface

type APILockInterface interface {
	// Lock read APIs
	LockRead()
	// Lock write APIs
	LockWrite()
	// Unlock read APIs
	UnlockRead()
	// Unlock write APIs
	UnlockWrite()
}

APILockInterface enables users to lock a specific set of APIs

type AuthInboundMiddleware

type AuthInboundMiddleware struct {
	auth.SecurityManager
}

AuthInboundMiddleware is the inbound middleware for auth

func NewAuthInboundMiddleware

func NewAuthInboundMiddleware(security auth.SecurityManager) *AuthInboundMiddleware

NewAuthInboundMiddleware returns AuthInboundMiddleware with auth check

func (*AuthInboundMiddleware) Handle

Handle authenticates user and invokes the underlying handler

func (*AuthInboundMiddleware) HandleOneway

HandleOneway authenticates user and invokes the underlying handler

func (*AuthInboundMiddleware) HandleStream

HandleStream authenticates user and invokes the underlying handler

type LeaderCheckInboundMiddleware

type LeaderCheckInboundMiddleware struct {
	Nomination leader.Nomination
}

LeaderCheckInboundMiddleware validates inbound request are only served via leader

func (*LeaderCheckInboundMiddleware) Handle

Handle checks error returned by underlying handler and collect metrics

func (*LeaderCheckInboundMiddleware) HandleOneway

HandleOneway checks error returned by underlying handler and collect metrics

func (*LeaderCheckInboundMiddleware) HandleStream

HandleStream checks error returned by underlying handler and collect metrics

func (*LeaderCheckInboundMiddleware) SetNomination

func (m *LeaderCheckInboundMiddleware) SetNomination(nomination leader.Nomination)

SetNomination sets the nominator for checking the leadership of the node

type RateLimitConfig

type RateLimitConfig struct {
	Enabled bool
	// Methods is evaluated from top to down, and the first matched
	// config is applied
	Methods []struct {
		Name        string
		TokenBucket `yaml:",inline"`
	}
	// Default is the default rate limit config,
	// if the method called is not defined in Methods field.
	// If not set, there is no rate limit.
	Default *TokenBucket `yaml:",omitempty"`
}

type RateLimitInboundMiddleware

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

func NewRateLimitInboundMiddleware

func NewRateLimitInboundMiddleware(config RateLimitConfig) (*RateLimitInboundMiddleware, error)

func (*RateLimitInboundMiddleware) Handle

Handle checks rate limit quota and invokes underlying handler

func (*RateLimitInboundMiddleware) HandleOneway

HandleOneway checks rate limit quota and invokes underlying handler

func (*RateLimitInboundMiddleware) HandleStream

HandleStream checks rate limit quota and invokes underlying handler

type TokenBucket

type TokenBucket struct {
	// Rate for the token bucket rate limit algorithm,
	// If Rate < 0, there would be no rate limit
	Rate rate.Limit
	// Burst for the token bucket rate limit algorithm,
	// If Burst < 0, there would be no rate limit
	Burst int
}

type YAPRCMetricsInboundMiddleware

type YAPRCMetricsInboundMiddleware struct {
	Scope tally.Scope
}

YAPRCMetricsInboundMiddleware collects yarpc related metrics, such as error code

func (*YAPRCMetricsInboundMiddleware) Handle

Handle checks error returned by underlying handler and collect metrics

func (*YAPRCMetricsInboundMiddleware) HandleOneway

HandleOneway checks error returned by underlying handler and collect metrics

func (*YAPRCMetricsInboundMiddleware) HandleStream

HandleStream checks error returned by underlying handler and collect metrics

Jump to

Keyboard shortcuts

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