s3

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Get(key string) (io.ReadCloser, *int64, error)
}

Client is an interface to represent methods called to action upon S3

type ClientMock

type ClientMock struct {
	// GetFunc mocks the Get method.
	GetFunc func(key string) (io.ReadCloser, *int64, error)
	// contains filtered or unexported fields
}

ClientMock is a mock implementation of Client.

    func TestSomethingThatUsesClient(t *testing.T) {

        // make and configure a mocked Client
        mockedClient := &ClientMock{
            GetFunc: func(key string) (io.ReadCloser, *int64, error) {
	               panic("mock out the Get method")
            },
        }

        // use mockedClient in code that requires Client
        // and then make assertions.

    }

func (*ClientMock) Get

func (mock *ClientMock) Get(key string) (io.ReadCloser, *int64, error)

Get calls GetFunc.

func (*ClientMock) GetCalls

func (mock *ClientMock) GetCalls() []struct {
	Key string
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedClient.GetCalls())

Jump to

Keyboard shortcuts

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