client

package
v0.0.0-...-e48efe8 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package client provides a client to access to token bucket server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Take takes tokens from server.
	Take(chunkKey string, bucketKeys ...string) (bool, error)
	// TakeContext takes tokens from server.
	TakeContext(ctx context.Context, chunkKey string, bucketKeys ...string) (bool, error)
	// Ping verifies a connection to the server is still alive.
	Ping() error
	// PingContext verifies a connection to the server is still alive.
	PingContext(ctx context.Context) error
	// Close closes a connection.
	Close() error
}

Client is a client to access to token bucket server.

func NewInsecureClient

func NewInsecureClient(addr string) (Client, error)

NewInsecureClient constructs a new client without TLS.

Jump to

Keyboard shortcuts

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