graph

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackoffDuration

func BackoffDuration(usage int) time.Duration

func CheckResponse

func CheckResponse(resp *meta.Response) error

func IsRetryableHTTP

func IsRetryableHTTP(statusCode int) bool

Types

type Client

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

func NewClient

func NewClient(cfg ClientConfig) *Client

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, params url.Values) (*meta.Response, error)

func (*Client) Paginate

func (c *Client) Paginate(ctx context.Context, path string, params url.Values) *meta.PageIterator

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, params map[string]string) (*meta.Response, error)

func (*Client) SetDryRun

func (c *Client) SetDryRun(v bool)

func (*Client) SetVerbose

func (c *Client) SetVerbose(v bool)

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, path string, file io.Reader, filename string, size int64, params map[string]string) (*meta.Response, error)

type ClientConfig

type ClientConfig struct {
	AccessToken string
	APIVersion  string
}

type RateLimit

type RateLimit struct {
	Usage                int
	TotalTime            int
	TotalCPUTime         int
	EstimatedTimeToReset int
}

func ParseRateLimit

func ParseRateLimit(header http.Header) *RateLimit

type RetryConfig

type RetryConfig struct {
	MaxRetries int
	BaseDelay  time.Duration
}

func DefaultRetryConfig

func DefaultRetryConfig() RetryConfig

func (RetryConfig) DelayForAttempt

func (r RetryConfig) DelayForAttempt(attempt int) time.Duration

Jump to

Keyboard shortcuts

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