Documentation
¶
Index ¶
- type UploaderMock
- func (mock *UploaderMock) BucketName() string
- func (mock *UploaderMock) BucketNameCalls() []struct{}
- func (mock *UploaderMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (mock *UploaderMock) CheckerCalls() []struct{ ... }
- func (mock *UploaderMock) Config() aws.Config
- func (mock *UploaderMock) ConfigCalls() []struct{}
- func (mock *UploaderMock) Upload(ctx context.Context, input *s3.PutObjectInput, ...) (*manager.UploadOutput, error)
- func (mock *UploaderMock) UploadCalls() []struct{ ... }
- type VaultClientMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UploaderMock ¶
type UploaderMock struct { // BucketNameFunc mocks the BucketName method. BucketNameFunc func() string // CheckerFunc mocks the Checker method. CheckerFunc func(ctx context.Context, state *healthcheck.CheckState) error // ConfigFunc mocks the Config method. ConfigFunc func() aws.Config // UploadFunc mocks the Upload method. UploadFunc func(ctx context.Context, input *s3.PutObjectInput, options ...func(*manager.Uploader)) (*manager.UploadOutput, error) // contains filtered or unexported fields }
UploaderMock is a mock implementation of file.Uploader.
func TestSomethingThatUsesUploader(t *testing.T) { // make and configure a mocked file.Uploader mockedUploader := &UploaderMock{ BucketNameFunc: func() string { panic("mock out the BucketName method") }, CheckerFunc: func(ctx context.Context, state *healthcheck.CheckState) error { panic("mock out the Checker method") }, ConfigFunc: func() aws.Config { panic("mock out the Config method") }, UploadFunc: func(ctx context.Context, input *s3.PutObjectInput, options ...func(*manager.Uploader)) (*manager.UploadOutput, error) { panic("mock out the Upload method") }, } // use mockedUploader in code that requires file.Uploader // and then make assertions. }
func (*UploaderMock) BucketName ¶
func (mock *UploaderMock) BucketName() string
BucketName calls BucketNameFunc.
func (*UploaderMock) BucketNameCalls ¶
func (mock *UploaderMock) BucketNameCalls() []struct { }
BucketNameCalls gets all the calls that were made to BucketName. Check the length with:
len(mockedUploader.BucketNameCalls())
func (*UploaderMock) Checker ¶
func (mock *UploaderMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*UploaderMock) CheckerCalls ¶
func (mock *UploaderMock) CheckerCalls() []struct { Ctx context.Context State *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedUploader.CheckerCalls())
func (*UploaderMock) Config ¶ added in v1.28.0
func (mock *UploaderMock) Config() aws.Config
Config calls ConfigFunc.
func (*UploaderMock) ConfigCalls ¶ added in v1.28.0
func (mock *UploaderMock) ConfigCalls() []struct { }
ConfigCalls gets all the calls that were made to Config. Check the length with:
len(mockedUploader.ConfigCalls())
func (*UploaderMock) Upload ¶
func (mock *UploaderMock) Upload(ctx context.Context, input *s3.PutObjectInput, options ...func(*manager.Uploader)) (*manager.UploadOutput, error)
Upload calls UploadFunc.
func (*UploaderMock) UploadCalls ¶
func (mock *UploaderMock) UploadCalls() []struct { Ctx context.Context Input *s3.PutObjectInput Options []func(*manager.Uploader) }
UploadCalls gets all the calls that were made to Upload. Check the length with:
len(mockedUploader.UploadCalls())
type VaultClientMock ¶
type VaultClientMock struct { // WriteKeyFunc mocks the WriteKey method. WriteKeyFunc func(path string, key string, value string) error // contains filtered or unexported fields }
VaultClientMock is a mock implementation of file.VaultClient.
func TestSomethingThatUsesVaultClient(t *testing.T) { // make and configure a mocked file.VaultClient mockedVaultClient := &VaultClientMock{ WriteKeyFunc: func(path string, key string, value string) error { panic("mock out the WriteKey method") }, } // use mockedVaultClient in code that requires file.VaultClient // and then make assertions. }
func (*VaultClientMock) WriteKey ¶
func (mock *VaultClientMock) WriteKey(path string, key string, value string) error
WriteKey calls WriteKeyFunc.
func (*VaultClientMock) WriteKeyCalls ¶
func (mock *VaultClientMock) WriteKeyCalls() []struct { Path string Key string Value string }
WriteKeyCalls gets all the calls that were made to WriteKey. Check the length with:
len(mockedVaultClient.WriteKeyCalls())