istio: Index | Files

package storetest

import ""

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


Package Files


func SetupStoreForTest Uses

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.

type Memstore Uses

type Memstore struct {
    // contains filtered or unexported fields

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

func NewMemstore Uses

func NewMemstore() *Memstore

NewMemstore creates a new Memstore instance.

func (*Memstore) Delete Uses

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

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

func (*Memstore) Get Uses

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

Get implements store.Backend interface.

func (*Memstore) Init Uses

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

Init implements store.Backend interface.

func (*Memstore) List Uses

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

List implements store.Backend interface.

func (*Memstore) Put Uses

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

Put adds a new resource to the memstore.

func (*Memstore) Stop Uses

func (m *Memstore) Stop()

Stop implements store.Backend interface.

func (*Memstore) WaitForSynced Uses

func (m *Memstore) WaitForSynced(time.Duration) error

WaitForSynced implements store.Backend interface

func (*Memstore) Watch Uses

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

Watch implements store.Backend interface.

Package storetest imports 6 packages (graph) and is imported by 4 packages. Updated 2018-09-20. Refresh now. Tools for package owners.