gcsfake

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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

This section is empty.

Types

type BucketHandle

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

Attrs implements trivial stiface.BucketHandle.Attrs

func (BucketHandle) Objects

Objects implements stiface.BucketHandle.Objects

type GCSClient

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.

func (*GCSClient) AddTestBucket

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

AddTestBucket adds a fake bucket for testing.

func (GCSClient) Bucket

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

Bucket implements stiface.Client.Bucket

func (GCSClient) Close

func (c GCSClient) Close() error

Close implements stiface.Client.Close

Jump to

Keyboard shortcuts

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