cachetype

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MPL-2.0 Imports: 26 Imported by: 39

Documentation

Index

Constants

View Source
const (
	ConfigEntryListName = "config-entries"
	ConfigEntryName     = "config-entry"
)

Recommended name for registration.

View Source
const CatalogDatacentersName = "catalog-datacenters"

Recommended name for registration.

View Source
const CatalogListServicesName = "catalog-list-services"

Recommended name for registration.

View Source
const CatalogServiceListName = "catalog-services-list"

Recommended name for registration.

View Source
const CatalogServicesName = "catalog-services"

Recommended name for registration.

View Source
const CompiledDiscoveryChainName = "compiled-discovery-chain"

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 ExportedPeeredServicesName = "exported-peered-services"

Recommended name for registration.

View Source
const FederationStateListMeshGatewaysName = "federation-state-list-mesh-gateways"

Recommended name for registration.

View Source
const GatewayServicesName = "gateway-services"

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 IntentionUpstreamsDestinationName = "intention-upstreams-destination"

IntentionUpstreamsDestinationName Recommended name for registration.

View Source
const IntentionUpstreamsName = "intention-upstreams"

Recommended name for registration.

View Source
const InternalServiceDumpName = "service-dump"

Recommended name for registration.

View Source
const NodeServicesName = "node-services"

Recommended name for registration.

View Source
const PeeredUpstreamsName = "peered-upstreams"

Recommended name for registration.

View Source
const PreparedQueryName = "prepared-query"

Recommended name for registration.

View Source
const ResolvedServiceConfigName = "resolved-service-config"

Recommended name for registration.

View Source
const ServiceGatewaysName = "service-gateways"

Recommended name for registration.

View Source
const ServiceHTTPChecksName = "service-http-checks"

Recommended name for registration.

View Source
const TrustBundleListName = "trust-bundles"

Recommended name for registration.

View Source
const TrustBundleReadName = "peer-trust-bundle"

Recommended name for registration.

Variables

This section is empty.

Functions

func ConnectCALeafSuccess added in v1.8.1

func ConnectCALeafSuccess(authorityKeyID string) interface{}

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

func TestFetchChResult(t testinf.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 Agent added in v1.6.2

type Agent interface {
	ServiceHTTPBasedChecks(id structs.ServiceID) []structs.CheckType
	LocalState() *local.State
	LocalBlockingQuery(alwaysBlock bool, hash string, wait time.Duration,
		fn func(ws memdb.WatchSet) (string, interface{}, error)) (string, interface{}, error)
}

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

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

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

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

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

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

type ConfigEntryList added in v1.13.0

type ConfigEntryList struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

ConfigEntryList supports fetching discovering configuration entries

func (*ConfigEntryList) Fetch added in v1.13.0

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

type ConnectCALeafRequest

type ConnectCALeafRequest struct {
	Token          string
	Datacenter     string
	Service        string              // Service name, not ID
	Agent          string              // Agent name, not ID
	Kind           structs.ServiceKind // only mesh-gateway for now
	DNSSAN         []string
	IPSAN          []net.IP
	MinQueryIndex  uint64
	MaxQueryTime   time.Duration
	MustRevalidate bool

	acl.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

func (*ConnectCALeafRequest) TargetPartition added in v1.11.0

func (req *ConnectCALeafRequest) TargetPartition() 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

type ExportedPeeredServices added in v1.13.0

type ExportedPeeredServices struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

func (*ExportedPeeredServices) Fetch added in v1.13.0

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

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

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

type IntentionMatch

type IntentionMatch struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

IntentionMatch supports fetching the intentions via match queries.

func (*IntentionMatch) Fetch

type IntentionUpstreams added in v1.10.0

type IntentionUpstreams struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

IntentionUpstreams supports fetching upstreams for a given service name.

func (*IntentionUpstreams) Fetch added in v1.10.0

type IntentionUpstreamsDestination added in v1.13.0

type IntentionUpstreamsDestination struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

IntentionUpstreamsDestination supports fetching upstreams for a given gateway name.

func (*IntentionUpstreamsDestination) Fetch added in v1.13.0

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

type MockRPC

type MockRPC struct {
	mock.Mock
}

MockRPC is an autogenerated mock type for the RPC type

func NewMockRPC added in v1.13.0

func NewMockRPC(t testing.TB) *MockRPC

NewMockRPC creates a new instance of MockRPC. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func TestRPC

func TestRPC(t testinf.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 {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

NodeServices supports fetching discovering service instances via the catalog.

func (*NodeServices) Fetch added in v1.4.3

type PeeredUpstreams added in v1.13.0

type PeeredUpstreams struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

PeeredUpstreams supports fetching imported upstream candidates of a given partition.

func (*PeeredUpstreams) Fetch added in v1.13.0

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

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.

type RegisterOptionsBlockingNoRefresh added in v1.8.1

type RegisterOptionsBlockingNoRefresh struct{}

func (RegisterOptionsBlockingNoRefresh) RegisterOptions added in v1.8.1

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

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

type ServiceGateways added in v1.13.0

type ServiceGateways struct {
	RegisterOptionsBlockingRefresh
	RPC RPC
}

GatewayUpstreams supports fetching upstreams for a given gateway name.

func (*ServiceGateways) Fetch added in v1.13.0

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

type ServiceHTTPChecksRequest added in v1.6.2

type ServiceHTTPChecksRequest struct {
	ServiceID     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 added in v1.6.2

type TrustBundle added in v1.13.0

type TrustBundle struct {
	RegisterOptionsNoRefresh
	Client TrustBundleReader
}

TrustBundle supports fetching discovering service instances via prepared queries.

func (*TrustBundle) Fetch added in v1.13.0

type TrustBundleListRequest added in v1.13.0

type TrustBundleListRequest struct {
	Request *pbpeering.TrustBundleListByServiceRequest
	structs.QueryOptions
}

func (*TrustBundleListRequest) CacheInfo added in v1.13.0

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

type TrustBundleLister added in v1.13.0

type TrustBundleLister interface {
	TrustBundleListByService(
		ctx context.Context, in *pbpeering.TrustBundleListByServiceRequest, opts ...grpc.CallOption,
	) (*pbpeering.TrustBundleListByServiceResponse, error)
}

type TrustBundleReadRequest added in v1.13.0

type TrustBundleReadRequest struct {
	Request *pbpeering.TrustBundleReadRequest
	structs.QueryOptions
}

func (*TrustBundleReadRequest) CacheInfo added in v1.13.0

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

type TrustBundleReader added in v1.13.0

type TrustBundleReader interface {
	TrustBundleRead(
		ctx context.Context, in *pbpeering.TrustBundleReadRequest, opts ...grpc.CallOption,
	) (*pbpeering.TrustBundleReadResponse, error)
}

type TrustBundles added in v1.13.0

type TrustBundles struct {
	RegisterOptionsNoRefresh
	Client TrustBundleLister
}

TrustBundles supports fetching discovering service instances via prepared queries.

func (*TrustBundles) Fetch added in v1.13.0

Jump to

Keyboard shortcuts

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