Documentation ¶
Overview ¶
Code generated by mockery v1.0.0
Index ¶
- Constants
- func TestFetchCh(t testing.T, typ cache.Type, opts cache.FetchOptions, req cache.Request) <-chan interface{}
- func TestFetchChResult(t testing.T, ch <-chan interface{}, expected interface{})
- type ConnectCALeaf
- type ConnectCALeafRequest
- type ConnectCARoot
- type IntentionMatch
- type MockRPC
- type RPC
Constants ¶
const ConnectCALeafName = "connect-ca-leaf"
Recommended name for registration.
const ConnectCARootName = "connect-ca-root"
Recommended name for registration.
const IntentionMatchName = "intention-match"
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 ConnectCALeaf ¶
type ConnectCALeaf struct { RPC RPC // RPC client for remote requests Cache *cache.Cache // Cache that has CA root certs via ConnectCARoot // contains filtered or unexported fields }
ConnectCALeaf supports fetching and generating Connect leaf certificates.
func (*ConnectCALeaf) Fetch ¶
func (c *ConnectCALeaf) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ConnectCALeafRequest ¶
type ConnectCALeafRequest struct { Token string Datacenter string Service string // Service name, not ID MinQueryIndex uint64 }
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 (c *ConnectCARoot) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type IntentionMatch ¶
type IntentionMatch struct {
RPC RPC
}
IntentionMatch supports fetching the intentions via match queries.
func (*IntentionMatch) Fetch ¶
func (c *IntentionMatch) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)