cachetype

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Code generated by mockery v1.0.0

Index

Constants

View Source
const CatalogServicesName = "catalog-services"

Recommended name for registration.

View Source
const ConnectCALeafName = "connect-ca-leaf"

Recommended name for registration.

View Source
const ConnectCARootName = "connect-ca-root"

Recommended name for registration.

View Source
const HealthServicesName = "health-services"

Recommended name for registration.

View Source
const IntentionMatchName = "intention-match"

Recommended name for registration.

View Source
const NodeServicesName = "node-services"

Recommended name for registration.

View Source
const PreparedQueryName = "prepared-query"

Recommended name for registration.

Variables

This section is empty.

Functions

func TestFetchCh

func TestFetchCh(
	t testing.T,
	typ cache.Type,
	opts cache.FetchOptions,
	req cache.Request) <-chan interface{}

TestFetchCh returns a channel that returns the result of the Fetch call. This is useful for testing timing and concurrency with Fetch calls. Errors will show up as an error type on the resulting channel so a type switch should be used.

func TestFetchChResult

func TestFetchChResult(t testing.T, ch <-chan interface{}, expected interface{})

TestFetchChResult tests that the result from TestFetchCh matches within a reasonable period of time (it expects it to be "immediate" but waits some milliseconds).

Types

type CatalogServices added in v1.3.0

type CatalogServices struct {
	RPC RPC
}

CatalogServices supports fetching discovering service instances via the catalog.

func (*CatalogServices) Fetch added in v1.3.0

func (*CatalogServices) SupportsBlocking added in v1.3.0

func (c *CatalogServices) SupportsBlocking() bool

type ConnectCALeaf

type ConnectCALeaf struct {
	RPC        RPC          // RPC client for remote requests
	Cache      *cache.Cache // Cache that has CA root certs via ConnectCARoot
	Datacenter string       // This agent's datacenter

	// TestOverrideCAChangeInitialDelay allows overriding the random jitter after a
	// root change with a fixed delay. So far ths is only done in tests. If it's
	// zero the caChangeInitialSpreadDefault maximum jitter will be used but if
	// set, it overrides and provides a fixed delay. To essentially disable the
	// delay in tests they can set it to 1 nanosecond. We may separately allow
	// configuring the jitter limit by users later but this is different and for
	// tests only since we need to set a deterministic time delay in order to test
	// the behaviour here fully and determinstically.
	TestOverrideCAChangeInitialDelay time.Duration
	// contains filtered or unexported fields
}

ConnectCALeaf supports fetching and generating Connect leaf certificates.

func (*ConnectCALeaf) Fetch

func (*ConnectCALeaf) SupportsBlocking added in v1.3.0

func (c *ConnectCALeaf) SupportsBlocking() bool

type ConnectCALeafRequest

type ConnectCALeafRequest struct {
	Token         string
	Datacenter    string
	Service       string // Service name, not ID
	MinQueryIndex uint64
	MaxQueryTime  time.Duration
}

ConnectCALeafRequest is the cache.Request implementation for the ConnectCALeaf cache type. This is implemented here and not in structs since this is only used for cache-related requests and not forwarded directly to any Consul servers.

func (*ConnectCALeafRequest) CacheInfo

func (r *ConnectCALeafRequest) CacheInfo() cache.RequestInfo

type ConnectCARoot

type ConnectCARoot struct {
	RPC RPC
}

ConnectCARoot supports fetching the Connect CA roots. This is a straightforward cache type since it only has to block on the given index and return the data.

func (*ConnectCARoot) Fetch

func (*ConnectCARoot) SupportsBlocking added in v1.3.0

func (c *ConnectCARoot) SupportsBlocking() bool

type HealthServices added in v1.3.0

type HealthServices struct {
	RPC RPC
}

HealthServices supports fetching discovering service instances via the catalog.

func (*HealthServices) Fetch added in v1.3.0

func (*HealthServices) SupportsBlocking added in v1.3.0

func (c *HealthServices) SupportsBlocking() bool

type IntentionMatch

type IntentionMatch struct {
	RPC RPC
}

IntentionMatch supports fetching the intentions via match queries.

func (*IntentionMatch) Fetch

func (*IntentionMatch) SupportsBlocking added in v1.3.0

func (c *IntentionMatch) SupportsBlocking() bool

type MockRPC

type MockRPC struct {
	mock.Mock
}

MockRPC is an autogenerated mock type for the RPC type

func TestRPC

func TestRPC(t testing.T) *MockRPC

TestRPC returns a mock implementation of the RPC interface.

func (*MockRPC) RPC

func (_m *MockRPC) RPC(method string, args interface{}, reply interface{}) error

RPC provides a mock function with given fields: method, args, reply

type NodeServices added in v1.4.3

type NodeServices struct {
	RPC RPC
}

NodeServices supports fetching discovering service instances via the catalog.

func (*NodeServices) Fetch added in v1.4.3

func (*NodeServices) SupportsBlocking added in v1.4.3

func (c *NodeServices) SupportsBlocking() bool

type PreparedQuery added in v1.3.0

type PreparedQuery struct {
	RPC RPC
}

PreparedQuery supports fetching discovering service instances via prepared queries.

func (*PreparedQuery) Fetch added in v1.3.0

func (*PreparedQuery) SupportsBlocking added in v1.3.0

func (c *PreparedQuery) SupportsBlocking() bool

type RPC

type RPC interface {
	RPC(method string, args interface{}, reply interface{}) error
}

RPC is an interface that an RPC client must implement. This is a helper interface that is implemented by the agent delegate so that Type implementations can request RPC access.

Jump to

Keyboard shortcuts

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