throttlerclienttest

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package throttlerclienttest contains the testsuite against which each RPC implementation of the throttlerclient interface must be tested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestSuite

func TestSuite(t *testing.T, c throttlerclient.Client)

TestSuite runs the test suite on the given throttlerclient and throttlerserver.

func TestSuitePanics

func TestSuitePanics(t *testing.T, c throttlerclient.Client)

TestSuitePanics tests the panic handling of each RPC method. Unlike TestSuite it does not use the real throttler.managerImpl. Instead, it uses FakeManager which allows us to panic on each RPC.

Types

type FakeManager

type FakeManager struct {
}

FakeManager implements the throttler.Manager interface and panics on all methods defined in the interface.

func (*FakeManager) GetConfiguration

func (fm *FakeManager) GetConfiguration(throttlerName string) (map[string]*throttlerdatapb.Configuration, error)

GetConfiguration implements the throttler.Manager interface. It always panics.

func (*FakeManager) MaxRates

func (fm *FakeManager) MaxRates() map[string]int64

MaxRates implements the throttler.Manager interface. It always panics.

func (*FakeManager) ResetConfiguration

func (fm *FakeManager) ResetConfiguration(throttlerName string) ([]string, error)

ResetConfiguration implements the throttler.Manager interface. It always panics.

func (*FakeManager) SetMaxRate

func (fm *FakeManager) SetMaxRate(int64) []string

SetMaxRate implements the throttler.Manager interface. It always panics.

func (*FakeManager) UpdateConfiguration

func (fm *FakeManager) UpdateConfiguration(throttlerName string, configuration *throttlerdatapb.Configuration, copyZeroValues bool) ([]string, error)

UpdateConfiguration implements the throttler.Manager interface. It always panics.

Jump to

Keyboard shortcuts

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