consultest

package
v0.0.0-...-8223eb1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSession

func NewSession() consul.Session

Types

type FakePodStore

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

In memory consul store useful in tests. Currently does not implement the entire consul.Store interface

func NewFakePodStore

func NewFakePodStore(podResults map[FakePodStoreKey]manifest.Manifest, healthResults map[string]consul.WatchResult) *FakePodStore

func (*FakePodStore) AllPods

func (f *FakePodStore) AllPods(podPrefix consul.PodPrefix) ([]consul.ManifestResult, time.Duration, error)

func (*FakePodStore) DeletePod

func (f *FakePodStore) DeletePod(podPrefix consul.PodPrefix, hostname types.NodeName, podId types.PodID) (time.Duration, error)

func (*FakePodStore) DestroyLockHolder

func (*FakePodStore) DestroyLockHolder(id string) error

func (*FakePodStore) GetHealth

func (f *FakePodStore) GetHealth(service string, node types.NodeName) (consul.WatchResult, error)

func (*FakePodStore) GetServiceHealth

func (f *FakePodStore) GetServiceHealth(service string) (map[string]consul.WatchResult, error)

func (*FakePodStore) ListPods

func (f *FakePodStore) ListPods(podPrefix consul.PodPrefix, hostname types.NodeName) ([]consul.ManifestResult, time.Duration, error)

func (*FakePodStore) LockHolder

func (*FakePodStore) LockHolder(key string) (string, string, error)

func (*FakePodStore) NewHealthManager

func (*FakePodStore) NewHealthManager(node types.NodeName, logger logging.Logger) consul.HealthManager

func (*FakePodStore) NewSession

func (f *FakePodStore) NewSession(name string, renewalCh <-chan time.Time) (consul.Session, chan error, error)

func (*FakePodStore) NewUnmanagedSession

func (*FakePodStore) NewUnmanagedSession(session string, name string) consul.Session

func (*FakePodStore) Ping

func (*FakePodStore) Ping() error

func (*FakePodStore) Pod

func (f *FakePodStore) Pod(podPrefix consul.PodPrefix, hostname types.NodeName, podId types.PodID) (manifest.Manifest, time.Duration, error)

func (*FakePodStore) PutHealth

func (*FakePodStore) PutHealth(res consul.WatchResult) (time.Time, time.Duration, error)

func (*FakePodStore) SetPod

func (f *FakePodStore) SetPod(podPrefix consul.PodPrefix, hostname types.NodeName, manifest manifest.Manifest) (time.Duration, error)

func (*FakePodStore) WatchAllPods

func (*FakePodStore) WatchAllPods(podPrefix consul.PodPrefix, quitChan <-chan struct{}, errChan chan<- error, podChan chan<- []consul.ManifestResult, pauseTime time.Duration)

func (*FakePodStore) WatchPod

func (*FakePodStore) WatchPod(podPrefix consul.PodPrefix, nodename types.NodeName, podId types.PodID, quitChan <-chan struct{}, errChan chan<- error, podChan chan<- consul.ManifestResult)

func (*FakePodStore) WatchPods

func (*FakePodStore) WatchPods(podPrefix consul.PodPrefix, nodename types.NodeName, quitChan <-chan struct{}, errChan chan<- error, podChan chan<- []consul.ManifestResult)

type FakePodStoreKey

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

func FakePodStoreKeyFor

func FakePodStoreKeyFor(podPrefix consul.PodPrefix, hostname types.NodeName, podId types.PodID) FakePodStoreKey

type FakePreparer

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

func NewFakePreparer

func NewFakePreparer(podStore PodStore, logger logging.Logger) *FakePreparer

func (*FakePreparer) Disable

func (f *FakePreparer) Disable()

func (*FakePreparer) Enable

func (f *FakePreparer) Enable()

type PodStore

type PodStore interface {
	AllPods(podPrefix consul.PodPrefix) ([]consul.ManifestResult, time.Duration, error)
	SetPod(podPrefix consul.PodPrefix, nodename types.NodeName, manifest manifest.Manifest) (time.Duration, error)
	DeletePod(podPrefix consul.PodPrefix, nodename types.NodeName, podId types.PodID) (time.Duration, error)
}

Jump to

Keyboard shortcuts

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