Documentation ¶
Index ¶
- Constants
- func ChecksumReader(reader io.Reader) (uint64, error)
- func GetCosmosDBInstance() (string, func(), error)
- func GetDBInstance(pool *dockertest.Pool) (string, func())
- func GetDynamoDBInstance() (string, func(), error)
- func GetDynamoDBProd(ctx context.Context, tb testing.TB) kv.Store
- func Must(t testing.TB, err error)
- func MustDo(t testing.TB, what string, err error)
- func NewBlockAdapterByType(t testing.TB, blockstoreType string) block.Adapter
- func NewClientFromCreds(logger logging.Logger, accessKeyID string, secretAccessKey string, ...) (*apigen.ClientWithResponses, error)
- func NewRandomReader(rand *rand.Rand, size int64) io.Reader
- func ParseEndpointURL(logger logging.Logger, endpointURL string) string
- func PingPG(ctx context.Context, pool *pgxpool.Pool) error
- func RandomRune(rand *rand.Rand, num, den int) rune
- func RandomString(rand *rand.Rand, size int) string
- func SetupTestS3Client(endpoint, key, secret string, forcePathStyle bool) (*s3.Client, error)
- func SetupTestingEnv(params *SetupTestingEnvParams) (logging.Logger, apigen.ClientWithResponsesInterface, *s3.Client, string)
- func UniqueKVTableName() string
- func UniqueName() string
- func WithBlockstoreMetadata(bm *block.BlockstoreMetadata) func(a *MockAdapter)
- func WithEnvironmentVariable(t *testing.T, k, v string)
- func WithNamespaceRegion(region string) func(a *MockAdapter)
- type GetDBOption
- type GetDBOptions
- type MockAdapter
- func (a *MockAdapter) AbortMultiPartUpload(_ context.Context, _ block.ObjectPointer, _ string) error
- func (a *MockAdapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error)
- func (a *MockAdapter) BlockstoreType() string
- func (a *MockAdapter) CompleteMultiPartUpload(_ context.Context, _ block.ObjectPointer, _ string, ...) (*block.CompleteMultiPartUploadResponse, error)
- func (a *MockAdapter) Copy(_ context.Context, _, _ block.ObjectPointer) error
- func (a *MockAdapter) CreateMultiPartUpload(_ context.Context, _ block.ObjectPointer, _ *http.Request, ...) (*block.CreateMultiPartUploadResponse, error)
- func (a *MockAdapter) Exists(_ context.Context, _ block.ObjectPointer) (bool, error)
- func (a *MockAdapter) Get(_ context.Context, _ block.ObjectPointer) (io.ReadCloser, error)
- func (a *MockAdapter) GetPreSignedURL(_ context.Context, _ block.ObjectPointer, _ block.PreSignMode) (string, time.Time, error)
- func (a *MockAdapter) GetPresignUploadPartURL(_ context.Context, _ block.ObjectPointer, _ string, _ int) (string, error)
- func (a *MockAdapter) GetProperties(_ context.Context, _ block.ObjectPointer) (block.Properties, error)
- func (a *MockAdapter) GetRange(_ context.Context, _ block.ObjectPointer, _ int64, _ int64) (io.ReadCloser, error)
- func (a *MockAdapter) GetRegion(_ context.Context, _ string) (string, error)
- func (a *MockAdapter) GetStorageNamespaceInfo() block.StorageNamespaceInfo
- func (a *MockAdapter) GetWalker(_ *url.URL) (block.Walker, error)
- func (a *MockAdapter) ListParts(_ context.Context, _ block.ObjectPointer, _ string, _ block.ListPartsOpts) (*block.ListPartsResponse, error)
- func (a *MockAdapter) Put(_ context.Context, obj block.ObjectPointer, _ int64, reader io.Reader, ...) (*block.PutResponse, error)
- func (a *MockAdapter) Remove(_ context.Context, _ block.ObjectPointer) error
- func (a *MockAdapter) ResolveNamespace(storageNamespace, key string, identifierType block.IdentifierType) (block.QualifiedKey, error)
- func (a *MockAdapter) RuntimeStats() map[string]string
- func (a *MockAdapter) UploadCopyPart(_ context.Context, _, _ block.ObjectPointer, _ string, _ int) (*block.UploadPartResponse, error)
- func (a *MockAdapter) UploadCopyPartRange(_ context.Context, _, _ block.ObjectPointer, _ string, _ int, _, _ int64) (*block.UploadPartResponse, error)
- func (a *MockAdapter) UploadPart(_ context.Context, _ block.ObjectPointer, _ int64, _ io.Reader, _ string, ...) (*block.UploadPartResponse, error)
- type MockAdapterOption
- type SetupTestingEnvParams
Constants ¶
const ( DBName = "lakefs_db" DBContainerTimeoutSeconds = 60 * 30 // 30 minutes EnvKeyUseBlockAdapter = "USE_BLOCK_ADAPTER" // pragma: allowlist secret )
const ( DynamodbLocalPort = "6432" DynamodbLocalURI = "http://localhost:6432" DynamoDBScanLimit = 10 )
const (
CosmosDBLocalPort = "8081"
)
Variables ¶
This section is empty.
Functions ¶
func ChecksumReader ¶ added in v1.11.1
ChecksumReader returns the checksum (CRC-64) of the contents of reader.
func GetCosmosDBInstance ¶ added in v0.103.0
func GetDBInstance ¶
func GetDBInstance(pool *dockertest.Pool) (string, func())
func GetDynamoDBInstance ¶ added in v0.68.0
func GetDynamoDBProd ¶ added in v0.68.0
func NewBlockAdapterByType ¶
func NewClientFromCreds ¶ added in v0.43.0
func NewClientFromCreds(logger logging.Logger, accessKeyID string, secretAccessKey string, endpointURL string) (*apigen.ClientWithResponses, error)
NewClientFromCreds creates a client using the credentials of a user
func NewRandomReader ¶ added in v1.11.1
NewRandomReader returns a reader that will return size bytes from rand.
func ParseEndpointURL ¶ added in v0.43.0
ParseEndpointURL parses the given endpoint string
func RandomRune ¶ added in v0.51.0
RandomRune returns a random Unicode rune from rand, weighting at least num out of den runes to be ASCII.
func RandomString ¶ added in v0.51.0
RandomString returns a random UTF-8 string of size or almost size bytes from rand. It is weighted towards using many ASCII characters.
func SetupTestS3Client ¶ added in v0.82.0
func SetupTestingEnv ¶
func SetupTestingEnv(params *SetupTestingEnvParams) (logging.Logger, apigen.ClientWithResponsesInterface, *s3.Client, string)
func UniqueKVTableName ¶ added in v0.68.0
func UniqueKVTableName() string
func UniqueName ¶ added in v0.109.0
func UniqueName() string
func WithBlockstoreMetadata ¶ added in v1.26.0
func WithBlockstoreMetadata(bm *block.BlockstoreMetadata) func(a *MockAdapter)
func WithEnvironmentVariable ¶ added in v0.87.0
WithEnvironmentVariable Sets an environment variable for the duration of the test,
restoring it to a previous value, if any, at teardown.
Warning: Environment variables affect other goroutines that might be running at the same time -
so this function is *not* thread safe.
func WithNamespaceRegion ¶ added in v1.26.0
func WithNamespaceRegion(region string) func(a *MockAdapter)
Types ¶
type GetDBOption ¶
type GetDBOption func(options *GetDBOptions)
type GetDBOptions ¶
type GetDBOptions struct {
ApplyDDL bool
}
type MockAdapter ¶ added in v1.26.0
type MockAdapter struct { TotalSize int64 Count int LastBucket string LastStorageClass *string // contains filtered or unexported fields }
func NewMockAdapter ¶ added in v1.26.0
func NewMockAdapter(opts ...MockAdapterOption) *MockAdapter
func (*MockAdapter) AbortMultiPartUpload ¶ added in v1.26.0
func (a *MockAdapter) AbortMultiPartUpload(_ context.Context, _ block.ObjectPointer, _ string) error
func (*MockAdapter) BlockstoreMetadata ¶ added in v1.26.0
func (a *MockAdapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error)
func (*MockAdapter) BlockstoreType ¶ added in v1.26.0
func (a *MockAdapter) BlockstoreType() string
func (*MockAdapter) CompleteMultiPartUpload ¶ added in v1.26.0
func (a *MockAdapter) CompleteMultiPartUpload(_ context.Context, _ block.ObjectPointer, _ string, _ *block.MultipartUploadCompletion) (*block.CompleteMultiPartUploadResponse, error)
func (*MockAdapter) Copy ¶ added in v1.26.0
func (a *MockAdapter) Copy(_ context.Context, _, _ block.ObjectPointer) error
func (*MockAdapter) CreateMultiPartUpload ¶ added in v1.26.0
func (a *MockAdapter) CreateMultiPartUpload(_ context.Context, _ block.ObjectPointer, _ *http.Request, _ block.CreateMultiPartUploadOpts) (*block.CreateMultiPartUploadResponse, error)
func (*MockAdapter) Exists ¶ added in v1.26.0
func (a *MockAdapter) Exists(_ context.Context, _ block.ObjectPointer) (bool, error)
func (*MockAdapter) Get ¶ added in v1.26.0
func (a *MockAdapter) Get(_ context.Context, _ block.ObjectPointer) (io.ReadCloser, error)
func (*MockAdapter) GetPreSignedURL ¶ added in v1.26.0
func (a *MockAdapter) GetPreSignedURL(_ context.Context, _ block.ObjectPointer, _ block.PreSignMode) (string, time.Time, error)
func (*MockAdapter) GetPresignUploadPartURL ¶ added in v1.26.0
func (a *MockAdapter) GetPresignUploadPartURL(_ context.Context, _ block.ObjectPointer, _ string, _ int) (string, error)
func (*MockAdapter) GetProperties ¶ added in v1.26.0
func (a *MockAdapter) GetProperties(_ context.Context, _ block.ObjectPointer) (block.Properties, error)
func (*MockAdapter) GetRange ¶ added in v1.26.0
func (a *MockAdapter) GetRange(_ context.Context, _ block.ObjectPointer, _ int64, _ int64) (io.ReadCloser, error)
func (*MockAdapter) GetStorageNamespaceInfo ¶ added in v1.26.0
func (a *MockAdapter) GetStorageNamespaceInfo() block.StorageNamespaceInfo
func (*MockAdapter) ListParts ¶ added in v1.26.0
func (a *MockAdapter) ListParts(_ context.Context, _ block.ObjectPointer, _ string, _ block.ListPartsOpts) (*block.ListPartsResponse, error)
func (*MockAdapter) Put ¶ added in v1.26.0
func (a *MockAdapter) Put(_ context.Context, obj block.ObjectPointer, _ int64, reader io.Reader, opts block.PutOpts) (*block.PutResponse, error)
func (*MockAdapter) Remove ¶ added in v1.26.0
func (a *MockAdapter) Remove(_ context.Context, _ block.ObjectPointer) error
func (*MockAdapter) ResolveNamespace ¶ added in v1.26.0
func (a *MockAdapter) ResolveNamespace(storageNamespace, key string, identifierType block.IdentifierType) (block.QualifiedKey, error)
func (*MockAdapter) RuntimeStats ¶ added in v1.26.0
func (a *MockAdapter) RuntimeStats() map[string]string
func (*MockAdapter) UploadCopyPart ¶ added in v1.26.0
func (a *MockAdapter) UploadCopyPart(_ context.Context, _, _ block.ObjectPointer, _ string, _ int) (*block.UploadPartResponse, error)
func (*MockAdapter) UploadCopyPartRange ¶ added in v1.26.0
func (a *MockAdapter) UploadCopyPartRange(_ context.Context, _, _ block.ObjectPointer, _ string, _ int, _, _ int64) (*block.UploadPartResponse, error)
func (*MockAdapter) UploadPart ¶ added in v1.26.0
func (a *MockAdapter) UploadPart(_ context.Context, _ block.ObjectPointer, _ int64, _ io.Reader, _ string, _ int) (*block.UploadPartResponse, error)
type MockAdapterOption ¶ added in v1.26.0
type MockAdapterOption func(a *MockAdapter)