testutils

package
v1.0.0-dev-2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package testutils is a generated GoMock package.

Index

Constants

View Source
const RFC3339Regex = "" // nolint:lll

/* 161-byte string literal not displayed */

Variables

View Source
var FlagKeyNotStringResult = MissingFlagKeyResult
View Source
var MissingFlagKeyResult = `` /* 216-byte string literal not displayed */
View Source
var MongoFindResultFlagNoStr = `` /* 440-byte string literal not displayed */
View Source
var MongoFindResultString = `` /* 445-byte string literal not displayed */
View Source
var MongoMissingFlagKey = `` /* 425-byte string literal not displayed */
View Source
var QueryResult = `` /* 431-byte string literal not displayed */

Functions

func CopyContentToExistingTempFile

func CopyContentToExistingTempFile(t *testing.T, content string, file *os.File) *os.File

func CopyContentToNewTempFile

func CopyContentToNewTempFile(t *testing.T, content string) *os.File

func CopyFileToExistingTempFile

func CopyFileToExistingTempFile(t *testing.T, src string, file *os.File) *os.File

func CopyFileToNewTempFile

func CopyFileToNewTempFile(t *testing.T, src string) *os.File

func EncodedMd5Hash

func EncodedMd5Hash(content []byte) string

func GetFreePort

func GetFreePort(t *testing.T) int

GetFreePort returns a free port on the local machine.

func GetFreePortAsString

func GetFreePortAsString(t *testing.T) string

GetFreePortAsString returns a free port on the local machine as a string.

func ReplaceAndCopyFileToExistingFile

func ReplaceAndCopyFileToExistingFile(t *testing.T, src string, dstFile *os.File, old, newStr string) *os.File

func ReplaceInFile

func ReplaceInFile(t *testing.T, file *os.File, old, newStr string)

Types

type ExportableMockEvent

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

func NewExportableMockEvent

func NewExportableMockEvent(name string) ExportableMockEvent

func (ExportableMockEvent) FormatInCSV

func (e ExportableMockEvent) FormatInCSV(_ *template.Template) ([]byte, error)

func (ExportableMockEvent) FormatInJSON

func (e ExportableMockEvent) FormatInJSON() ([]byte, error)

func (ExportableMockEvent) GetCreationDate

func (e ExportableMockEvent) GetCreationDate() int64

func (ExportableMockEvent) GetKey

func (e ExportableMockEvent) GetKey() string

func (ExportableMockEvent) GetUserKey

func (e ExportableMockEvent) GetUserKey() string

type GCStorageReaderMock

type GCStorageReaderMock struct {
	ShouldFail bool
	FileToRead string
	// contains filtered or unexported fields
}

func (*GCStorageReaderMock) Close

func (r *GCStorageReaderMock) Close() error

func (*GCStorageReaderMock) Read

func (r *GCStorageReaderMock) Read(p []byte) (n int, err error)

type HTTPClientMock

type HTTPClientMock struct {
	ForceError bool
	StatusCode int
	Body       string
	Signature  string
	Headers    map[string][]string
}

func (*HTTPClientMock) Do

func (h *HTTPClientMock) Do(req *http.Request) (*http.Response, error)

type MockedStorage

type MockedStorage struct {
	Server *fakestorage.Server
}

func NewMockedGCS

func NewMockedGCS(t *testing.T) MockedStorage

func (MockedStorage) WithFiles

func (m MockedStorage) WithFiles(t *testing.T, bucketName string, files map[string]string)

type Mockobject

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

Mockobject is a mock of object interface.

func NewMockobject

func NewMockobject(ctrl *gomock.Controller) *Mockobject

NewMockobject creates a new mock instance.

func (*Mockobject) Attrs

func (m *Mockobject) Attrs(ctx context.Context) (*storage.ObjectAttrs, error)

Attrs mocks base method.

func (*Mockobject) EXPECT

func (m *Mockobject) EXPECT() *MockobjectMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mockobject) NewReader

func (m *Mockobject) NewReader(ctx context.Context) (*storage.Reader, error)

NewReader mocks base method.

type MockobjectMockRecorder

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

MockobjectMockRecorder is the mock recorder for Mockobject.

func (*MockobjectMockRecorder) Attrs

func (mr *MockobjectMockRecorder) Attrs(ctx any) *gomock.Call

Attrs indicates an expected call of Attrs.

func (*MockobjectMockRecorder) NewReader

func (mr *MockobjectMockRecorder) NewReader(ctx any) *gomock.Call

NewReader indicates an expected call of NewReader.

type S3ManagerV2Mock

type S3ManagerV2Mock struct {
	S3ManagerMockFileSystem map[string]string
	TestDataLocation        string
}

func (*S3ManagerV2Mock) Download

func (s *S3ManagerV2Mock) Download(
	ctx context.Context,
	w io.WriterAt,
	input *s3.GetObjectInput,
	options ...func(*manager.Downloader),
) (n int64, err error)

func (*S3ManagerV2Mock) Upload

func (s *S3ManagerV2Mock) Upload(
	ctx context.Context,
	uploadInput *s3.PutObjectInput,
	opts ...func(uploader *manager.Uploader),
) (*manager.UploadOutput, error)

Directories

Path Synopsis
mockretriever
Package mockretriever provides mock implementations of various retriever interfaces for testing purposes in the go-feature-flag project.
Package mockretriever provides mock implementations of various retriever interfaces for testing purposes in the go-feature-flag project.

Jump to

Keyboard shortcuts

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