pkg

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCustomRejectedExecutionHandler

func GetCustomRejectedExecutionHandler() filter.RejectedExecutionHandler

func GetDefaultValueRejectedExecutionHandlerSingleton

func GetDefaultValueRejectedExecutionHandlerSingleton() filter.RejectedExecutionHandler

*

  • the better way is designing the RejectedExecutionHandler as singleton.

Types

type DefaultValueRejectedExecutionHandler

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

*

  • The RejectedExecutionHandler is used by some components,
  • e.g, ExecuteLimitFilter, GracefulShutdownFilter, TpsLimitFilter.
  • When the requests are rejected, the RejectedExecutionHandler allows you to do something.
  • You can alert the developer, or redirect those requests to another providers. It depends on what you need. *
  • Let's assume that you need a RejectedExecutionHandler which will return some default result if the request was rejected.

func (*DefaultValueRejectedExecutionHandler) RejectedExecution

func (mh *DefaultValueRejectedExecutionHandler) RejectedExecution(url *common.URL, invocation protocol.Invocation) protocol.Result

type RandomTpsLimitStrategy

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

*

  • The RandomTpsLimitStrategy should not be singleton because different TpsLimiter will create many instances.
  • we won't want them affect each other.

func (RandomTpsLimitStrategy) IsAllowable

func (r RandomTpsLimitStrategy) IsAllowable() bool

type RandomTpsLimitStrategyCreator

type RandomTpsLimitStrategyCreator struct{}

func (*RandomTpsLimitStrategyCreator) Create

func (creator *RandomTpsLimitStrategyCreator) Create(rate int, interval int) filter.TpsLimitStrategy

type User

type User struct {
	ID   string
	Name string
	Age  int32
	Time time.Time
}

func (User) JavaClassName

func (u User) JavaClassName() string

type UserProvider

type UserProvider struct {
}

func (*UserProvider) GetUser

func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, error)

func (*UserProvider) Reference added in v1.5.7

func (u *UserProvider) Reference() string

Jump to

Keyboard shortcuts

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