throttlerclient

package
Version: v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package throttlerclient defines the generic RPC client interface for the throttler service. It has to be implemented for the different RPC frameworks e.g. gRPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFactory

func RegisterFactory(name string, factory Factory)

RegisterFactory allows a client implementation to register itself.

Types

type Client

type Client interface {
	// MaxRates returns the current max rate for each throttler of the process.
	MaxRates(ctx context.Context) (map[string]int64, error)

	// SetMaxRate allows to change the current max rate for all throttlers
	// of the process.
	SetMaxRate(ctx context.Context, rate int64) ([]string, error)

	// Close will terminate the connection and free resources.
	Close()
}

Client defines the generic RPC interface for the throttler service.

func New

func New(addr string) (Client, error)

New will return a client for the selected RPC implementation.

type Factory

type Factory func(addr string) (Client, error)

Factory has to be implemented and must create a new RPC client for a given "addr".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL