configuration

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://api.hubapi.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	APIKey                 string             // API key for authentication
	AccessToken            string             // Access token for authentication
	DeveloperAPIKey        string             // Developer API key
	BasePath               string             // Base URL for API requests
	DefaultHeaders         map[string]string  // Default headers for requests
	NumberOfAPICallRetries int                // API call retry count
	LimiterOptions         *LimiterOptions    // Rate limiter configuration
	LimiterJobOptions      *LimiterJobOptions // Per-job rate limiter options
	HTTPAgent              *http.Transport    // HTTP transport agent
}

Configuration struct holds all settings required for API requests.

func NewConfiguration

func NewConfiguration(
	apiKey, accessToken, developerAPIKey, basePath string,
	defaultHeaders map[string]string,
	retries int,
	limiterOptions *LimiterOptions,
	jobOptions *LimiterJobOptions,
	httpAgent *http.Transport,
) *Configuration

NewConfiguration creates a new Configuration.

type LimiterJobOptions

type LimiterJobOptions struct {
	Expiration time.Duration // Time after which the job expires
}

LimiterJobOptions represents options for individual jobs within the rate limiter.

type LimiterOptions

type LimiterOptions struct {
	MaxConcurrent            int           // Maximum concurrent jobs
	MinTime                  time.Duration // Minimum time between each job
	Reservoir                int           // Initial tokens in the reservoir
	ReservoirRefreshInterval time.Duration // Interval to refresh reservoir tokens
	ReservoirRefreshAmount   int           // Tokens added on each refresh
}

LimiterOptions represents the configuration options for a rate limiter.

Jump to

Keyboard shortcuts

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