Documentation ¶
Overview ¶
Code generated by mockery v1.0.0
Index ¶
- Constants
- func ConnectCALeafSuccess(authorityKeyID string) interface{}
- 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 Agent
- type CatalogDatacenters
- type CatalogListServices
- type CatalogServiceList
- type CatalogServices
- type CompiledDiscoveryChain
- type ConfigEntries
- type ConfigEntry
- type ConnectCALeaf
- type ConnectCALeafRequest
- type ConnectCARoot
- type FederationStateListMeshGateways
- type GatewayServices
- type HealthServices
- type IntentionMatch
- type InternalServiceDump
- type MaterializerDeps
- type MockRPC
- type NodeServices
- type PreparedQuery
- type RPC
- type RegisterOptionsBlockingNoRefresh
- type RegisterOptionsBlockingRefresh
- type RegisterOptionsNoRefresh
- type ResolvedServiceConfig
- type ServiceHTTPChecks
- type ServiceHTTPChecksRequest
- type StreamingHealthServices
Constants ¶
const ( ConfigEntriesName = "config-entries" ConfigEntryName = "config-entry" )
Recommended name for registration.
const CatalogDatacentersName = "catalog-datacenters"
Recommended name for registration.
const CatalogListServicesName = "catalog-list-services"
Recommended name for registration.
const CatalogServiceListName = "catalog-services-list"
Recommended name for registration.
const CatalogServicesName = "catalog-services"
Recommended name for registration.
const CompiledDiscoveryChainName = "compiled-discovery-chain"
Recommended name for registration.
const ConnectCALeafName = "connect-ca-leaf"
Recommended name for registration.
const ConnectCARootName = "connect-ca-root"
Recommended name for registration.
const FederationStateListMeshGatewaysName = "federation-state-list-mesh-gateways"
Recommended name for registration.
const GatewayServicesName = "gateway-services"
Recommended name for registration.
const HealthServicesName = "health-services"
Recommended name for registration.
const IntentionMatchName = "intention-match"
Recommended name for registration.
const InternalServiceDumpName = "service-dump"
Recommended name for registration.
const NodeServicesName = "node-services"
Recommended name for registration.
const PreparedQueryName = "prepared-query"
Recommended name for registration.
const ResolvedServiceConfigName = "resolved-service-config"
Recommended name for registration.
const ServiceHTTPChecksName = "service-http-checks"
Recommended name for registration.
const (
// Recommended name for registration.
StreamingHealthServicesName = "streaming-health-services"
)
Variables ¶
This section is empty.
Functions ¶
func ConnectCALeafSuccess ¶ added in v1.8.1
func ConnectCALeafSuccess(authorityKeyID string) interface{}
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 CatalogDatacenters ¶ added in v1.6.0
type CatalogDatacenters struct { RegisterOptionsNoRefresh RPC RPC }
Datacenters supports fetching discovering all the known datacenters
func (*CatalogDatacenters) Fetch ¶ added in v1.6.0
func (c *CatalogDatacenters) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CatalogListServices ¶ added in v1.6.0
type CatalogListServices struct { RegisterOptionsBlockingRefresh RPC RPC }
CatalogListServices supports fetching discovering service names via the catalog.
func (*CatalogListServices) Fetch ¶ added in v1.6.0
func (c *CatalogListServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CatalogServiceList ¶ added in v1.7.0
type CatalogServiceList struct { RegisterOptionsBlockingRefresh RPC RPC }
CatalogServiceList supports fetching service names via the catalog.
func (*CatalogServiceList) Fetch ¶ added in v1.7.0
func (c *CatalogServiceList) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CatalogServices ¶ added in v1.3.0
type CatalogServices struct { RegisterOptionsBlockingRefresh RPC RPC }
CatalogServices supports fetching discovering service instances via the catalog.
func (*CatalogServices) Fetch ¶ added in v1.3.0
func (c *CatalogServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CompiledDiscoveryChain ¶ added in v1.6.0
type CompiledDiscoveryChain struct { RegisterOptionsBlockingRefresh RPC RPC }
CompiledDiscoveryChain supports fetching the complete discovery chain for a service and caching its compilation.
func (*CompiledDiscoveryChain) Fetch ¶ added in v1.6.0
func (c *CompiledDiscoveryChain) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ConfigEntries ¶ added in v1.6.0
type ConfigEntries struct { RegisterOptionsBlockingRefresh RPC RPC }
ConfigEntries supports fetching discovering configuration entries
func (*ConfigEntries) Fetch ¶ added in v1.6.0
func (c *ConfigEntries) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ConfigEntry ¶ added in v1.8.0
type ConfigEntry struct { RegisterOptionsBlockingRefresh RPC RPC }
ConfigEntry supports fetching a single configuration entry.
func (*ConfigEntry) Fetch ¶ added in v1.8.0
func (c *ConfigEntry) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ConnectCALeaf ¶
type ConnectCALeaf struct { RegisterOptionsBlockingNoRefresh 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 behavior here fully and determinstically. TestOverrideCAChangeInitialDelay time.Duration // 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 Agent string // Agent name, not ID DNSSAN []string IPSAN []net.IP MinQueryIndex uint64 MaxQueryTime time.Duration structs.EnterpriseMeta }
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
func (*ConnectCALeafRequest) Key ¶ added in v1.5.2
func (r *ConnectCALeafRequest) Key() string
func (*ConnectCALeafRequest) TargetNamespace ¶ added in v1.7.0
func (req *ConnectCALeafRequest) TargetNamespace() string
type ConnectCARoot ¶
type ConnectCARoot struct { RegisterOptionsBlockingRefresh 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 FederationStateListMeshGateways ¶ added in v1.8.0
type FederationStateListMeshGateways struct { RegisterOptionsBlockingRefresh RPC RPC }
FederationState supports fetching federation states.
func (*FederationStateListMeshGateways) Fetch ¶ added in v1.8.0
func (c *FederationStateListMeshGateways) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type GatewayServices ¶ added in v1.8.0
type GatewayServices struct { RegisterOptionsBlockingRefresh RPC RPC }
GatewayUpstreams supports fetching upstreams for a given gateway name.
func (*GatewayServices) Fetch ¶ added in v1.8.0
func (g *GatewayServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type HealthServices ¶ added in v1.3.0
type HealthServices struct { RegisterOptionsBlockingRefresh RPC RPC }
HealthServices supports fetching discovering service instances via the catalog.
func (*HealthServices) Fetch ¶ added in v1.3.0
func (c *HealthServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type IntentionMatch ¶
type IntentionMatch struct { RegisterOptionsBlockingRefresh 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)
type InternalServiceDump ¶ added in v1.6.0
type InternalServiceDump struct { RegisterOptionsBlockingRefresh RPC RPC }
InternalServiceDump supports fetching discovering service names via the catalog.
func (*InternalServiceDump) Fetch ¶ added in v1.6.0
func (c *InternalServiceDump) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type MaterializerDeps ¶ added in v1.9.0
type MaterializerDeps struct { Client submatview.StreamClient Logger hclog.Logger }
type MockRPC ¶
MockRPC is an autogenerated mock type for the RPC type
type NodeServices ¶ added in v1.4.3
type NodeServices struct { RegisterOptionsBlockingRefresh RPC RPC }
NodeServices supports fetching discovering service instances via the catalog.
func (*NodeServices) Fetch ¶ added in v1.4.3
func (c *NodeServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type PreparedQuery ¶ added in v1.3.0
type PreparedQuery struct { RegisterOptionsNoRefresh RPC RPC }
PreparedQuery supports fetching discovering service instances via prepared queries.
func (*PreparedQuery) Fetch ¶ added in v1.3.0
func (c *PreparedQuery) Fetch(_ cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type RPC ¶
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.
type RegisterOptionsBlockingNoRefresh ¶ added in v1.8.1
type RegisterOptionsBlockingNoRefresh struct{}
func (RegisterOptionsBlockingNoRefresh) RegisterOptions ¶ added in v1.8.1
func (r RegisterOptionsBlockingNoRefresh) RegisterOptions() cache.RegisterOptions
type RegisterOptionsBlockingRefresh ¶ added in v1.8.0
type RegisterOptionsBlockingRefresh struct{}
RegisterOptionsBlockingRefresh can be embedded into a struct to implement part of the agent/cache.Type interface. When embedded into a struct it identifies the cache type as one which supports blocking, and uses refresh to keep the cache fresh.
func (RegisterOptionsBlockingRefresh) RegisterOptions ¶ added in v1.8.0
func (r RegisterOptionsBlockingRefresh) RegisterOptions() cache.RegisterOptions
type RegisterOptionsNoRefresh ¶ added in v1.8.0
type RegisterOptionsNoRefresh struct{}
RegisterOptionsNoRefresh can be embedded into a struct to implement part of the agent/cache.Type interface. When embedded into a struct it identifies the cache type as one which does not support blocking, and should not be refreshed.
func (RegisterOptionsNoRefresh) RegisterOptions ¶ added in v1.8.0
func (r RegisterOptionsNoRefresh) RegisterOptions() cache.RegisterOptions
type ResolvedServiceConfig ¶ added in v1.5.0
type ResolvedServiceConfig struct { RegisterOptionsBlockingRefresh RPC RPC }
ResolvedServiceConfig supports fetching the config for a service resolved from the global proxy defaults and the centrally registered service config.
func (*ResolvedServiceConfig) Fetch ¶ added in v1.5.0
func (c *ResolvedServiceConfig) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ServiceHTTPChecks ¶ added in v1.6.2
type ServiceHTTPChecks struct { RegisterOptionsBlockingRefresh Agent Agent }
ServiceHTTPBasedChecks supports fetching discovering checks in the local state
func (*ServiceHTTPChecks) Fetch ¶ added in v1.6.2
func (c *ServiceHTTPChecks) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ServiceHTTPChecksRequest ¶ added in v1.6.2
type ServiceHTTPChecksRequest struct { ServiceID string MinQueryIndex uint64 MaxQueryTime time.Duration structs.EnterpriseMeta }
ServiceHTTPChecksRequest is the cache.Request implementation for the ServiceHTTPBasedChecks 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 (*ServiceHTTPChecksRequest) CacheInfo ¶ added in v1.6.2
func (s *ServiceHTTPChecksRequest) CacheInfo() cache.RequestInfo
type StreamingHealthServices ¶ added in v1.9.0
type StreamingHealthServices struct { RegisterOptionsBlockingRefresh // contains filtered or unexported fields }
StreamingHealthServices supports fetching discovering service instances via the catalog using the streaming gRPC endpoint.
func NewStreamingHealthServices ¶ added in v1.9.0
func NewStreamingHealthServices(deps MaterializerDeps) *StreamingHealthServices
NewStreamingHealthServices creates a cache-type for watching for service health results via streaming updates.
func (*StreamingHealthServices) Fetch ¶ added in v1.9.0
func (c *StreamingHealthServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
Fetch service health from the materialized view. If no materialized view exists, create one and start it running in a goroutine. The goroutine will exit when the cache entry storing the result is expired, the cache will call Close on the result.State.
Fetch implements part of the cache.Type interface, and assumes that the caller ensures that only a single call to Fetch is running at any time.
func (*StreamingHealthServices) RegisterOptions ¶ added in v1.9.0
func (c *StreamingHealthServices) RegisterOptions() cache.RegisterOptions
RegisterOptions returns options with a much shorter LastGetTTL than the default. Unlike other cache-types, StreamingHealthServices runs a materialized view in the background which will receive streamed events from a server. If the cache is not being used, that stream uses memory on the server and network transfer between the client and the server. The materialize view and the stream are stopped when the cache entry expires, so using a shorter TTL ensures the cache entry expires sooner.
Source Files ¶
- catalog_datacenters.go
- catalog_list_services.go
- catalog_service_list.go
- catalog_services.go
- config_entry.go
- connect_ca_leaf.go
- connect_ca_leaf_oss.go
- connect_ca_root.go
- discovery_chain.go
- federation_state_list_gateways.go
- gateway_services.go
- health_services.go
- intention_match.go
- mock_RPC.go
- node_services.go
- options.go
- prepared_query.go
- resolved_service_config.go
- rpc.go
- service_checks.go
- service_dump.go
- streaming_health_services.go
- testing.go