client

package
v0.1.1-pre.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockTestHelper

func MockTestHelper(t *testing.T, table *schema.Table, createService func() (*heroku.Service, error), options TestOptions)

Types

type BackoffSettings

type BackoffSettings struct {
	Gax        gax.Backoff
	Backoff    backoff.Config
	MaxRetries int
}

type Client

type Client struct {
	Heroku *heroku.Service
	// contains filtered or unexported fields
}

Client is what you need to create and initialize in Configure. It will be passed for each resource fetcher.

func (*Client) Logger

func (c *Client) Logger() *zerolog.Logger

type Config

type Config struct {
	Token string `yaml:"token"`
}

func NewConfig

func NewConfig() *Config

func (Config) Example

func (Config) Example() string

type Paginator

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

Paginator implements the http.RoundTripper interface to intercept pagination information not supported by the official Heroku SDK. It injects this information into the request context so that resolvers can make additional calls, if necessary.

func NewPaginator

func NewPaginator(t http.RoundTripper) Paginator

NewPaginator returns a new paginator with the given RoundTripper

func (Paginator) RoundTrip

func (p Paginator) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip is an implementation of the http.RoundTripper function that checks the status code and adds pagination information to the context accordingly. This is only done because the official SDK lacks support for pagination (see: https://github.com/heroku/heroku-go/issues/56)

type Spec

type Spec struct {
	Token string `yaml:"token,omitempty" json:"token"`

	BaseDelay         int     `yaml:"backoff_base_delay,omitempty" hcl:"backoff_base_delay,optional" default:"-1"`
	Multiplier        float64 `yaml:"backoff_multiplier,omitempty" hcl:"backoff_multiplier,optional"`
	MaxDelay          int     `yaml:"backoff_max_delay,omitempty" hcl:"backoff_max_delay,optional"`
	Jitter            float64 `yaml:"backoff_jitter,omitempty" hcl:"backoff_jitter,optional"`
	MinConnectTimeout int     `yaml:"backoff_min_connect_timeout,omitempty" hcl:"backoff_min_connect_timeout,optional"`
	MaxRetries        int     `yaml:"max_retries,omitempty" hcl:"max_retries,optional" default:"3"`
}

Spec defines Heroku source plugin Spec

func (Spec) Backoff

func (c Spec) Backoff() BackoffSettings

func (Spec) ClientOptions

func (c Spec) ClientOptions() []option.ClientOption

type TestOptions

type TestOptions struct{}

Jump to

Keyboard shortcuts

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