cloudtest

package
v0.1.73 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cloudtest provides utilities for testing, e.g. cloud service tests using mock http Transport, fake storage client, etc.

Package cloudtest provides utilities for testing, e.g. cloud service tests using mock http Transport, fake storage client, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingClient

func LoggingClient(client *http.Client) (*http.Client, error)

LoggingClient is an HTTP client that also logs all requests and responses.

func NewChannelClient

func NewChannelClient(c <-chan *http.Response) *http.Client

NewChannelClient is an HTTP client that ignores requests and returns responses provided by a channel.

func NewLoggingClient

func NewLoggingClient() *http.Client

NewLoggingClient returns an HTTP client that also logs all requests and responses.

Types

type BucketHandle added in v0.1.10

type BucketHandle struct {
	stiface.BucketHandle
	ObjAttrs []*storage.ObjectAttrs // Objects that will be returned by iterator
}

BucketHandle provides a fake BucketHandle implementation for testing.

func (BucketHandle) Attrs added in v0.1.10

Attrs implements trivial stiface.BucketHandle.Attrs

func (BucketHandle) Objects added in v0.1.10

Objects implements stiface.BucketHandle.Objects

type GCSClient added in v0.1.10

type GCSClient struct {
	stiface.Client
	// contains filtered or unexported fields
}

GCSClient provides a fake storage client that can be customized with arbitrary fake bucket contents. DEPRECATED - use identical code in cloud/gcsfake

func (*GCSClient) AddTestBucket added in v0.1.10

func (c *GCSClient) AddTestBucket(name string, bh BucketHandle)

AddTestBucket adds a fake bucket for testing. DEPRECATED - use identical code in cloud/gcsfake

func (GCSClient) Bucket added in v0.1.10

func (c GCSClient) Bucket(name string) stiface.BucketHandle

Bucket implements stiface.Client.Bucket

func (GCSClient) Close added in v0.1.10

func (c GCSClient) Close() error

Close implements stiface.Client.Close

Directories

Path Synopsis
Package bqfake provides tools to construct fake bigquery datasets, tables, query responses, etc.
Package bqfake provides tools to construct fake bigquery datasets, tables, query responses, etc.
Package dsfake implements a fake dsiface.Client If you make changes to existing code, please test whether it breaks existing clients, e.g.
Package dsfake implements a fake dsiface.Client If you make changes to existing code, please test whether it breaks existing clients, e.g.
Package cloudtest provides utilities for testing, e.g.
Package cloudtest provides utilities for testing, e.g.

Jump to

Keyboard shortcuts

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