Versions in this module Expand all Collapse all v1 v1.0.0 Jan 25, 2023 Changes in this version + func GetAllResourceReferences(resourceGroups [types.UnknownType]Resources) map[resource.Type]map[string]bool + func GetResourceName(res types.Resource) string + func GetResourceNames(resources []types.Resource) []string + func GetResourceReferences(resources map[string]types.ResourceWithTTL) map[resource.Type]map[string]bool + func GetResponseType(typeURL resource.Type) types.ResponseType + func GetResponseTypeURL(responseType types.ResponseType) (string, error) + func HashResource(resource []byte) string + func IndexRawResourcesByName(items []types.Resource) map[string]types.Resource + func IndexResourcesByName(items []types.ResourceWithTTL) map[string]types.ResourceWithTTL + func MarshalResource(resource types.Resource) (types.MarshaledResource, error) + type Cache interface + type ConfigFetcher interface + Fetch func(context.Context, *Request) (Response, error) + type ConfigWatcher interface + CreateDeltaWatch func(*DeltaRequest, stream.StreamState, chan DeltaResponse) (cancel func()) + CreateWatch func(*Request, stream.StreamState, chan Response) (cancel func()) + type DeltaPassthroughResponse struct + DeltaDiscoveryResponse *discovery.DeltaDiscoveryResponse + DeltaRequest *discovery.DeltaDiscoveryRequest + NextVersionMap map[string]string + func (r *DeltaPassthroughResponse) GetContext() context.Context + func (r *DeltaPassthroughResponse) GetDeltaDiscoveryResponse() (*discovery.DeltaDiscoveryResponse, error) + func (r *DeltaPassthroughResponse) GetDeltaRequest() *discovery.DeltaDiscoveryRequest + func (r *DeltaPassthroughResponse) GetNextVersionMap() map[string]string + func (r *DeltaPassthroughResponse) GetSystemVersion() (string, error) + type DeltaRequest = discovery.DeltaDiscoveryRequest + type DeltaResponse interface + GetContext func() context.Context + GetDeltaDiscoveryResponse func() (*discovery.DeltaDiscoveryResponse, error) + GetDeltaRequest func() *discovery.DeltaDiscoveryRequest + GetNextVersionMap func() map[string]string + GetSystemVersion func() (string, error) + type DeltaResponseWatch struct + Request *DeltaRequest + Response chan DeltaResponse + StreamState stream.StreamState + type IDHash struct + func (IDHash) ID(node *core.Node) string + type LinearCache struct + func NewLinearCache(typeURL string, opts ...LinearCacheOption) *LinearCache + func (cache *LinearCache) CreateDeltaWatch(request *DeltaRequest, state stream.StreamState, value chan DeltaResponse) func() + func (cache *LinearCache) CreateWatch(request *Request, streamState stream.StreamState, value chan Response) func() + func (cache *LinearCache) DeleteResource(name string) error + func (cache *LinearCache) Fetch(ctx context.Context, request *Request) (Response, error) + func (cache *LinearCache) GetResources() map[string]types.Resource + func (cache *LinearCache) NumDeltaWatches() int + func (cache *LinearCache) NumResources() int + func (cache *LinearCache) NumWatches(name string) int + func (cache *LinearCache) SetResources(resources map[string]types.Resource) + func (cache *LinearCache) UpdateResource(name string, res types.Resource) error + func (cache *LinearCache) UpdateResources(toUpdate map[string]types.Resource, toDelete []string) error + type LinearCacheOption func(*LinearCache) + func WithInitialResources(resources map[string]types.Resource) LinearCacheOption + func WithLogger(log log.Logger) LinearCacheOption + func WithVersionPrefix(prefix string) LinearCacheOption + type MuxCache struct + Caches map[string]Cache + Classify func(*Request) string + ClassifyDelta func(*DeltaRequest) string + func (mux *MuxCache) CreateDeltaWatch(request *DeltaRequest, state stream.StreamState, value chan DeltaResponse) func() + func (mux *MuxCache) CreateWatch(request *Request, state stream.StreamState, value chan Response) func() + func (mux *MuxCache) Fetch(ctx context.Context, request *Request) (Response, error) + type NodeHash interface + ID func(node *core.Node) string + type PassthroughResponse struct + DiscoveryResponse *discovery.DiscoveryResponse + Request *discovery.DiscoveryRequest + func (r *PassthroughResponse) GetContext() context.Context + func (r *PassthroughResponse) GetDiscoveryResponse() (*discovery.DiscoveryResponse, error) + func (r *PassthroughResponse) GetRequest() *discovery.DiscoveryRequest + func (r *PassthroughResponse) GetVersion() (string, error) + type RawDeltaResponse struct + Ctx context.Context + DeltaRequest *discovery.DeltaDiscoveryRequest + NextVersionMap map[string]string + RemovedResources []string + Resources []types.Resource + SystemVersionInfo string + func (r *RawDeltaResponse) GetContext() context.Context + func (r *RawDeltaResponse) GetDeltaDiscoveryResponse() (*discovery.DeltaDiscoveryResponse, error) + func (r *RawDeltaResponse) GetDeltaRequest() *discovery.DeltaDiscoveryRequest + func (r *RawDeltaResponse) GetNextVersionMap() map[string]string + func (r *RawDeltaResponse) GetSystemVersion() (string, error) + type RawResponse struct + Ctx context.Context + Heartbeat bool + Request *discovery.DiscoveryRequest + Resources []types.ResourceWithTTL + Version string + func (r *RawResponse) GetContext() context.Context + func (r *RawResponse) GetDiscoveryResponse() (*discovery.DiscoveryResponse, error) + func (r *RawResponse) GetRequest() *discovery.DiscoveryRequest + func (r *RawResponse) GetVersion() (string, error) + type Request = discovery.DiscoveryRequest + type ResourceSnapshot interface + ConstructVersionMap func() error + GetResources func(typeURL string) map[string]types.Resource + GetResourcesAndTTL func(typeURL string) map[string]types.ResourceWithTTL + GetVersion func(typeURL string) string + GetVersionMap func(typeURL string) map[string]string + type Resources struct + Items map[string]types.ResourceWithTTL + Version string + func NewResources(version string, items []types.Resource) Resources + func NewResourcesWithTTL(version string, items []types.ResourceWithTTL) Resources + type Response interface + GetContext func() context.Context + GetDiscoveryResponse func() (*discovery.DiscoveryResponse, error) + GetRequest func() *discovery.DiscoveryRequest + GetVersion func() (string, error) + type ResponseWatch struct + Request *Request + Response chan Response + type Snapshot struct + Resources [types.UnknownType]Resources + VersionMap map[string]map[string]string + func NewSnapshot(version string, resources map[resource.Type][]types.Resource) (*Snapshot, error) + func NewSnapshotWithTTLs(version string, resources map[resource.Type][]types.ResourceWithTTL) (*Snapshot, error) + func (s *Snapshot) Consistent() error + func (s *Snapshot) ConstructVersionMap() error + func (s *Snapshot) GetResources(typeURL resource.Type) map[string]types.Resource + func (s *Snapshot) GetResourcesAndTTL(typeURL resource.Type) map[string]types.ResourceWithTTL + func (s *Snapshot) GetVersion(typeURL resource.Type) string + func (s *Snapshot) GetVersionMap(typeURL string) map[string]string + type SnapshotCache interface + ClearSnapshot func(node string) + GetSnapshot func(node string) (ResourceSnapshot, error) + GetStatusInfo func(string) StatusInfo + GetStatusKeys func() []string + SetSnapshot func(ctx context.Context, node string, snapshot ResourceSnapshot) error + func NewSnapshotCache(ads bool, hash NodeHash, logger log.Logger) SnapshotCache + func NewSnapshotCacheWithHeartbeating(ctx context.Context, ads bool, hash NodeHash, logger log.Logger, ...) SnapshotCache + type StatusInfo interface + GetLastDeltaWatchRequestTime func() time.Time + GetLastWatchRequestTime func() time.Time + GetNode func() *core.Node + GetNumDeltaWatches func() int + GetNumWatches func() int