mock

package
v0.0.0-...-cbcb865 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetaRepository

func NewMetaRepository() repository.MetaRepository

func NewS3Client

func NewS3Client(region string) adaptor.S3Client

NewS3Client is constructor of S3 Mock

func NewSQSClient

func NewSQSClient(region string) adaptor.SQSClient

NewSQSClient creates mock SQS client

Types

type ChunkMockDB

type ChunkMockDB struct {
	Data map[string]map[string]*models.Chunk
}

ChunkMockDB is mock of ChunkDynamoDB

func NewChunkMockDB

func NewChunkMockDB() *ChunkMockDB

NewChunkMockDB is constructor of ChunkMockDB

func (*ChunkMockDB) DeleteChunk

func (x *ChunkMockDB) DeleteChunk(chunk *models.Chunk) (*models.Chunk, error)

func (*ChunkMockDB) FreezeChunk

func (x *ChunkMockDB) FreezeChunk(chunk *models.Chunk) (*models.Chunk, error)

func (*ChunkMockDB) GetMergableChunks

func (x *ChunkMockDB) GetMergableChunks(schema string, createdBefore time.Time, minChunkSize int64) ([]*models.Chunk, error)

GetMergableChunks returns mergable chunks exceeding freezedAt or minChunkSize

func (*ChunkMockDB) GetWritableChunks

func (x *ChunkMockDB) GetWritableChunks(schema, partition string, writableTotalSize int64) ([]*models.Chunk, error)

GetWritableChunks returns writable chunks for now (because chunks are not locked)

func (*ChunkMockDB) PutChunk

func (x *ChunkMockDB) PutChunk(recordID string, objSize int64, schema, partition string, created time.Time) error

PutChunk saves a new chunk into DB. The chunk must be overwritten by UUID.

func (*ChunkMockDB) UpdateChunk

func (x *ChunkMockDB) UpdateChunk(chunk *models.Chunk, recordID string, objSize, writableSize int64) error

type MetaRepository

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

func (*MetaRepository) GetObjecID

func (x *MetaRepository) GetObjecID(s3path string) (int64, error)

func (*MetaRepository) GetRecordObjects

func (x *MetaRepository) GetRecordObjects(recordIDs []string, schema models.ParquetSchemaName) ([]*repository.MetaRecordObject, error)

func (*MetaRepository) HeadPartition

func (x *MetaRepository) HeadPartition(partitionKey string) (bool, error)

func (*MetaRepository) PutPartition

func (x *MetaRepository) PutPartition(partitionKey string) error

func (*MetaRepository) PutRecordObjects

func (x *MetaRepository) PutRecordObjects(objects []*repository.MetaRecordObject) error

type S3Client

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

S3Client is on memory S3Client mock

func (*S3Client) DeleteObjects

func (x *S3Client) DeleteObjects(input *s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error)

DeleteObjects of S3Client remove []bytes from memory

func (*S3Client) GetObject

func (x *S3Client) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)

GetObject of S3Client loads []bytes from memory

func (*S3Client) HeadObject

func (x *S3Client) HeadObject(input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)

func (*S3Client) PutObject

func (x *S3Client) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)

PutObject of S3Client saves []bytes to memory

func (*S3Client) Upload

func (x *S3Client) Upload(bucket, key string, body io.Reader, encoding string) error

Upload of S3Client put data from io.Reader

type SQSClient

type SQSClient struct {
	Input []*sqs.SendMessageInput

	Region string
	// contains filtered or unexported fields
}

SQSClient is mock of AWS SQS SDK

func (*SQSClient) DeleteMessage

func (x *SQSClient) DeleteMessage(input *sqs.DeleteMessageInput) (*sqs.DeleteMessageOutput, error)

func (*SQSClient) ReceiveMessage

func (x *SQSClient) ReceiveMessage(input *sqs.ReceiveMessageInput) (*sqs.ReceiveMessageOutput, error)

func (*SQSClient) SendMessage

func (x *SQSClient) SendMessage(input *sqs.SendMessageInput) (*sqs.SendMessageOutput, error)

SendMessage of mock just stores SendMessage input

type SQSClientFactory

type SQSClientFactory func(region string) adaptor.SQSClient

SQSClientFactory is interface SQSClient constructor

Jump to

Keyboard shortcuts

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