Documentation
¶
Index ¶
- Constants
- func TestFetchCh(t testinf.T, typ cache.Type, opts cache.FetchOptions, req cache.Request) <-chan interface{}
- func TestFetchChResult(t testinf.T, ch <-chan interface{}, expected interface{})
- type Agent
- type CatalogDatacenters
- type CatalogListServices
- type CatalogServiceList
- type CatalogServices
- type CompiledDiscoveryChain
- type ConfigEntry
- type ConfigEntryList
- type ConnectCARoot
- type ExportedPeeredServices
- type FederationStateListMeshGateways
- type GatewayServices
- type HealthServices
- type IntentionMatch
- type IntentionUpstreams
- type IntentionUpstreamsDestination
- type InternalServiceDump
- type MockRPC
- type NodeServices
- type PeeredUpstreams
- type PeeringListRequest
- type PeeringLister
- type Peerings
- type PreparedQuery
- type RPC
- type RegisterOptionsBlockingNoRefresh
- type RegisterOptionsBlockingRefresh
- type RegisterOptionsNoRefresh
- type ResolvedServiceConfig
- type ServiceGateways
- type ServiceHTTPChecks
- type ServiceHTTPChecksRequest
- type TrustBundle
- type TrustBundleListRequest
- type TrustBundleLister
- type TrustBundleReadRequest
- type TrustBundleReader
- type TrustBundles
Constants ¶
const ( ConfigEntryListName = "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 ConnectCARootName = "connect-ca-root"
Recommended name for registration.
const ExportedPeeredServicesName = "exported-peered-services"
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 IntentionUpstreamsDestinationName = "intention-upstreams-destination"
IntentionUpstreamsDestinationName Recommended name for registration.
const IntentionUpstreamsName = "intention-upstreams"
Recommended name for registration.
const InternalServiceDumpName = "service-dump"
Recommended name for registration.
const NodeServicesName = "node-services"
Recommended name for registration.
const PeeredUpstreamsName = "peered-upstreams"
Recommended name for registration.
const PeeringListName = "peers"
PeeringListName is the recommended name for registration.
const PreparedQueryName = "prepared-query"
Recommended name for registration.
const ResolvedServiceConfigName = "resolved-service-config"
Recommended name for registration.
const ServiceGatewaysName = "service-gateways"
Recommended name for registration.
const ServiceHTTPChecksName = "service-http-checks"
Recommended name for registration.
const TrustBundleListName = "trust-bundles"
Recommended name for registration.
const TrustBundleReadName = "peer-trust-bundle"
Recommended name for registration.
Variables ¶
This section is empty.
Functions ¶
func TestFetchCh ¶
func TestFetchCh( t testinf.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 ¶
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 ¶
type CatalogDatacenters struct {
RegisterOptionsNoRefresh
RPC RPC
}
Datacenters supports fetching discovering all the known datacenters
func (*CatalogDatacenters) Fetch ¶
func (c *CatalogDatacenters) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CatalogListServices ¶
type CatalogListServices struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
CatalogListServices supports fetching discovering service names via the catalog.
func (*CatalogListServices) Fetch ¶
func (c *CatalogListServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CatalogServiceList ¶
type CatalogServiceList struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
CatalogServiceList supports fetching service names via the catalog.
func (*CatalogServiceList) Fetch ¶
func (c *CatalogServiceList) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CatalogServices ¶
type CatalogServices struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
CatalogServices supports fetching discovering service instances via the catalog.
func (*CatalogServices) Fetch ¶
func (c *CatalogServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type CompiledDiscoveryChain ¶
type CompiledDiscoveryChain struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
CompiledDiscoveryChain supports fetching the complete discovery chain for a service and caching its compilation.
func (*CompiledDiscoveryChain) Fetch ¶
func (c *CompiledDiscoveryChain) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ConfigEntry ¶
type ConfigEntry struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
ConfigEntry supports fetching a single configuration entry.
func (*ConfigEntry) Fetch ¶
func (c *ConfigEntry) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ConfigEntryList ¶
type ConfigEntryList struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
ConfigEntryList supports fetching discovering configuration entries
func (*ConfigEntryList) Fetch ¶
func (c *ConfigEntryList) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
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 ExportedPeeredServices ¶
type ExportedPeeredServices struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
func (*ExportedPeeredServices) Fetch ¶
func (c *ExportedPeeredServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type FederationStateListMeshGateways ¶
type FederationStateListMeshGateways struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
FederationState supports fetching federation states.
func (*FederationStateListMeshGateways) Fetch ¶
func (c *FederationStateListMeshGateways) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type GatewayServices ¶
type GatewayServices struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
GatewayUpstreams supports fetching upstreams for a given gateway name.
func (*GatewayServices) Fetch ¶
func (g *GatewayServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type HealthServices ¶
type HealthServices struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
HealthServices supports fetching discovering service instances via the catalog.
func (*HealthServices) Fetch ¶
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 IntentionUpstreams ¶
type IntentionUpstreams struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
IntentionUpstreams supports fetching upstreams for a given service name.
func (*IntentionUpstreams) Fetch ¶
func (i *IntentionUpstreams) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type IntentionUpstreamsDestination ¶
type IntentionUpstreamsDestination struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
IntentionUpstreamsDestination supports fetching upstreams for a given gateway name.
func (*IntentionUpstreamsDestination) Fetch ¶
func (i *IntentionUpstreamsDestination) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type InternalServiceDump ¶
type InternalServiceDump struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
InternalServiceDump supports fetching discovering service names via the catalog.
func (*InternalServiceDump) Fetch ¶
func (c *InternalServiceDump) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type MockRPC ¶
MockRPC is an autogenerated mock type for the RPC type
func NewMockRPC ¶
func NewMockRPC(t mockConstructorTestingTNewMockRPC) *MockRPC
NewMockRPC creates a new instance of MockRPC. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type NodeServices ¶
type NodeServices struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
NodeServices supports fetching discovering service instances via the catalog.
func (*NodeServices) Fetch ¶
func (c *NodeServices) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type PeeredUpstreams ¶
type PeeredUpstreams struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
PeeredUpstreams supports fetching imported upstream candidates of a given partition.
func (*PeeredUpstreams) Fetch ¶
func (i *PeeredUpstreams) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type PeeringListRequest ¶
type PeeringListRequest struct {
Request *pbpeering.PeeringListRequest
structs.QueryOptions
}
PeeringListRequest represents the combination of request payload and options that would normally be sent over headers.
func (*PeeringListRequest) CacheInfo ¶
func (r *PeeringListRequest) CacheInfo() cache.RequestInfo
type PeeringLister ¶
type PeeringLister interface {
PeeringList(
ctx context.Context, in *pbpeering.PeeringListRequest, opts ...grpc.CallOption,
) (*pbpeering.PeeringListResponse, error)
}
type Peerings ¶
type Peerings struct {
RegisterOptionsBlockingRefresh
Client PeeringLister
}
Peerings supports fetching the list of peers for a given partition or wildcard-specifier.
func (*Peerings) Fetch ¶
func (t *Peerings) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type PreparedQuery ¶
type PreparedQuery struct {
RegisterOptionsNoRefresh
RPC RPC
}
PreparedQuery supports fetching discovering service instances via prepared queries.
func (*PreparedQuery) Fetch ¶
func (c *PreparedQuery) Fetch(_ cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type RPC ¶
type RPC interface {
RPC(ctx context.Context, 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.
type RegisterOptionsBlockingNoRefresh ¶
type RegisterOptionsBlockingNoRefresh struct{}
func (RegisterOptionsBlockingNoRefresh) RegisterOptions ¶
func (r RegisterOptionsBlockingNoRefresh) RegisterOptions() cache.RegisterOptions
type RegisterOptionsBlockingRefresh ¶
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 ¶
func (r RegisterOptionsBlockingRefresh) RegisterOptions() cache.RegisterOptions
type RegisterOptionsNoRefresh ¶
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 ¶
func (r RegisterOptionsNoRefresh) RegisterOptions() cache.RegisterOptions
type ResolvedServiceConfig ¶
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 ¶
func (c *ResolvedServiceConfig) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ServiceGateways ¶
type ServiceGateways struct {
RegisterOptionsBlockingRefresh
RPC RPC
}
GatewayUpstreams supports fetching upstreams for a given gateway name.
func (*ServiceGateways) Fetch ¶
func (g *ServiceGateways) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ServiceHTTPChecks ¶
type ServiceHTTPChecks struct {
RegisterOptionsBlockingRefresh
Agent Agent
}
ServiceHTTPBasedChecks supports fetching discovering checks in the local state
func (*ServiceHTTPChecks) Fetch ¶
func (c *ServiceHTTPChecks) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type ServiceHTTPChecksRequest ¶
type ServiceHTTPChecksRequest struct {
ServiceID string
NodeName string
MinQueryIndex uint64
MaxQueryTime time.Duration
acl.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 ¶
func (s *ServiceHTTPChecksRequest) CacheInfo() cache.RequestInfo
type TrustBundle ¶
type TrustBundle struct {
RegisterOptionsBlockingRefresh
Client TrustBundleReader
}
TrustBundle supports fetching discovering service instances via prepared queries.
func (*TrustBundle) Fetch ¶
func (t *TrustBundle) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
type TrustBundleListRequest ¶
type TrustBundleListRequest struct {
Request *pbpeering.TrustBundleListByServiceRequest
structs.QueryOptions
}
TrustBundleListRequest represents the combination of request payload and options that would normally be sent over headers.
func (*TrustBundleListRequest) CacheInfo ¶
func (r *TrustBundleListRequest) CacheInfo() cache.RequestInfo
type TrustBundleLister ¶
type TrustBundleLister interface {
TrustBundleListByService(
ctx context.Context, in *pbpeering.TrustBundleListByServiceRequest, opts ...grpc.CallOption,
) (*pbpeering.TrustBundleListByServiceResponse, error)
}
type TrustBundleReadRequest ¶
type TrustBundleReadRequest struct {
Request *pbpeering.TrustBundleReadRequest
structs.QueryOptions
}
TrustBundleReadRequest represents the combination of request payload and options that would normally be sent over headers.
func (*TrustBundleReadRequest) CacheInfo ¶
func (r *TrustBundleReadRequest) CacheInfo() cache.RequestInfo
type TrustBundleReader ¶
type TrustBundleReader interface {
TrustBundleRead(
ctx context.Context, in *pbpeering.TrustBundleReadRequest, opts ...grpc.CallOption,
) (*pbpeering.TrustBundleReadResponse, error)
}
type TrustBundles ¶
type TrustBundles struct {
RegisterOptionsBlockingRefresh
Client TrustBundleLister
}
TrustBundles supports fetching discovering service instances via prepared queries.
func (*TrustBundles) Fetch ¶
func (t *TrustBundles) Fetch(opts cache.FetchOptions, req cache.Request) (cache.FetchResult, error)
Source Files
¶
- catalog_datacenters.go
- catalog_list_services.go
- catalog_service_list.go
- catalog_services.go
- config_entry.go
- connect_ca_root.go
- discovery_chain.go
- exported_peered_services.go
- federation_state_list_gateways.go
- gateway_services.go
- health_services.go
- intention_match.go
- intention_upstreams.go
- intention_upstreams_destination.go
- mock_RPC.go
- node_services.go
- options.go
- peered_upstreams.go
- peerings.go
- prepared_query.go
- resolved_service_config.go
- rpc.go
- service_checks.go
- service_dump.go
- service_gateways.go
- testing.go
- trust_bundle.go
- trust_bundles.go