go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/throttler/throttlerclient Index | Files

package throttlerclient

import "gopkg.in/src-d/go-vitess.v1/vt/throttler/throttlerclient"

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

Package Files

throttlerclient.go

func RegisterFactory Uses

func RegisterFactory(name string, factory Factory)

RegisterFactory allows a client implementation to register itself.

type Client Uses

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.
    // It returns the names of the updated throttlers.
    SetMaxRate(ctx context.Context, rate int64) ([]string, error)

    // GetConfiguration returns the configuration of the MaxReplicationlag module
    // for the given throttler or all throttlers if "throttlerName" is empty.
    GetConfiguration(ctx context.Context, throttlerName string) (map[string]*throttlerdatapb.Configuration, error)

    // UpdateConfiguration (partially) updates the configuration of the
    // MaxReplicationlag module for the given throttler or all throttlers if
    // "throttlerName" is empty.
    // If "copyZeroValues" is true, fields with zero values will be copied
    // as well.
    // The function returns the names of the updated throttlers.
    UpdateConfiguration(ctx context.Context, throttlerName string, configuration *throttlerdatapb.Configuration, copyZeroValues bool) ([]string, error)

    // ResetConfiguration resets the configuration of the MaxReplicationlag module
    // to the initial configuration for the given throttler or all throttlers if
    // "throttlerName" is empty.
    // The function returns the names of the updated throttlers.
    ResetConfiguration(ctx context.Context, throttlerName string) ([]string, error)

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

Client defines the generic RPC interface for the throttler service.

func New Uses

func New(addr string) (Client, error)

New will return a client for the selected RPC implementation.

type Factory Uses

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

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

Package throttlerclient imports 5 packages (graph) and is imported by 6 packages. Updated 2019-06-13. Refresh now. Tools for package owners.