client

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 14 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
}

Client holds Github client with its underlying HTTP client and all its middlewares.

func New

func New(ctx context.Context, options ...Option) (*Client, error)

New creates a new client with optional middleware.

func (*Client) GithubClient

func (c *Client) GithubClient() *github.Client

GithubClient provides Github client with underlying HTTP middleware set.

type Option

type Option interface {
	Apply(ctx context.Context, client *Client) error
}

Option implements options for HTTP client.

func WithMetrics

func WithMetrics(enable bool) Option

WithMetrics adds metrics middleware to HTTP client.

func WithRateLimiter

func WithRateLimiter(remaining, safetyBuffer int, resetTime time.Time) Option

WithRateLimiter adds adaptative rate limiter middleware to HTTP client.

func WithRetry

func WithRetry(retryMax int, retryWaitMin time.Duration) Option

WithRetry adds retry middleware to HTTP client.

func WithToken

func WithToken(token string) Option

WithToken adds authentification middleware to HTTP client.

Jump to

Keyboard shortcuts

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