client

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg conf.ClientConfig, poolSize int) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) List

func (c *Client) List(ctx context.Context, ret *pb.LimiterList) error

func (*Client) NewLimiter

func (c *Client) NewLimiter(ctx context.Context, name string, rate int, interval time.Duration) error

func (*Client) RemoveLimiter

func (c *Client) RemoveLimiter(ctx context.Context, name string) error

func (*Client) Take

func (c *Client) Take(ctx context.Context, req *pb.Limiter) (time.Duration, error)

func (*Client) TakeAsync added in v1.0.5

func (c *Client) TakeAsync(ctx context.Context, req *pb.Limiter, ch chan<- Result) error

type Result added in v1.0.7

type Result struct {
	Duration time.Duration
	Error    error
}

Jump to

Keyboard shortcuts

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