mock

package
Version: v0.0.0-...-810cf82 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mock contains chunks.Store implementation for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemory

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

InMemory is a chunks.Store that all chunks in an in-memory map. It is intended for unit test use only.

func (*InMemory) Add

func (c *InMemory) Add(ctx context.Context, chunk *chunks.Chunk) (key cas.Key, err error)

Add adds a Chunk to the Store. See chunks.Store.Add.

func (*InMemory) Get

func (c *InMemory) Get(ctx context.Context, key cas.Key, typ string, level uint8) (*chunks.Chunk, error)

Get fetches a Chunk. See chunks.Store.Get.

type NeverUsed

type NeverUsed struct{}

NeverUsed is a chunks.Store meant for unit tests that don't touch the CAS, but where the API requires one.

func (NeverUsed) Add

func (NeverUsed) Add(ctx context.Context, chunk *chunks.Chunk) (key cas.Key, err error)

Add adds a Chunk to the Store. See chunks.Store.Add.

func (NeverUsed) Get

func (NeverUsed) Get(ctx context.Context, key cas.Key, typ string, level uint8) (*chunks.Chunk, error)

Get fetches a Chunk. See chunks.Store.Get.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL