mock

package
v0.0.0-...-42c81d0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2015 License: MIT Imports: 3 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(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(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(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(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
y or Y : Canonical URL