storetest

package
v0.0.0-...-fd0897c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package storetest provides the utility functions of config store for testing. Shouldn't be imported outside of the test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupStoreForTest

func SetupStoreForTest(data ...string) (store.Store, error)

SetupStoreForTest creates an on-memory store backend, initializes its data with the specified specs, and returns a new store with the backend. Note that this store can't change, Watch does not emit any events.

Types

type Memstore

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

Memstore is an on-memory store backend. Used only for testing.

func NewMemstore

func NewMemstore() *Memstore

NewMemstore creates a new Memstore instance.

func (*Memstore) Delete

func (m *Memstore) Delete(k store.Key)

Delete removes a resource for the specified key from the memstore.

func (*Memstore) Get

func (m *Memstore) Get(key store.Key) (*store.BackEndResource, error)

Get implements store.Backend interface.

func (*Memstore) Init

func (m *Memstore) Init(kinds []string) error

Init implements store.Backend interface.

func (*Memstore) List

func (m *Memstore) List() map[store.Key]*store.BackEndResource

List implements store.Backend interface.

func (*Memstore) Put

func (m *Memstore) Put(r *store.BackEndResource)

Put adds a new resource to the memstore.

func (*Memstore) Stop

func (m *Memstore) Stop()

Stop implements store.Backend interface.

func (*Memstore) Watch

func (m *Memstore) Watch() (<-chan store.BackendEvent, error)

Watch implements store.Backend interface.

Jump to

Keyboard shortcuts

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