cloud

package
v0.0.0-...-a6a2865 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cloud contains a generic cloud Config, and utilities like DryRunClient.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BQConfig

type BQConfig struct {
	Config
}

BQConfig provides a generic config suitable for BigQuery clients.

type Config

type Config struct {
	Project string // Project for most cloud ops.

	// client to be used for cloud API calls.  Allows injection of fake for testing.
	Client  *http.Client
	Options []option.ClientOption
}

Config provides a generic config suitable for many cloud clients.

type CountingTransport

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

CountingTransport counts calls, and returns OK and empty body. `count` field should only be accessed using atomic.Foobar

func DryRunClient

func DryRunClient() (*http.Client, *CountingTransport)

DryRunClient returns a client that just counts calls.

func (*CountingTransport) Count

func (ct *CountingTransport) Count() int32

Count returns the client call count.

func (*CountingTransport) Requests

func (ct *CountingTransport) Requests() []*http.Request

Requests returns the entire req from the last request

func (*CountingTransport) RoundTrip

func (ct *CountingTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface, logging the request, and the response body, (which may be json).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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