github.com/cilium/cilium@v1.16.2/pkg/fqdn/config.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package fqdn
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/cilium/cilium/pkg/ipcache"
    10  )
    11  
    12  // Config is a simple configuration structure to set how pkg/fqdn subcomponents
    13  // behave.
    14  type Config struct {
    15  	// MinTTL is the time used by the poller to cache information.
    16  	MinTTL int
    17  
    18  	// Cache is where the poller stores DNS data used to generate rules.
    19  	// When set to nil, it uses fqdn.DefaultDNSCache, a global cache instance.
    20  	Cache *DNSCache
    21  
    22  	// GetEndpointsDNSInfo is a function that returns a list of fqdn-relevant fields from all Endpoints known to the agent.
    23  	// The endpoint's DNSHistory and DNSZombies are used as part of the garbage collection and restoration processes.
    24  	//
    25  	// Optional parameter endpointID will cause this function to only return the endpoint with the specified ID.
    26  	GetEndpointsDNSInfo func(endpointID string) []EndpointDNSInfo
    27  
    28  	IPCache IPCache
    29  }
    30  
    31  type EndpointDNSInfo struct {
    32  	ID         string
    33  	ID64       int64
    34  	DNSHistory *DNSCache
    35  	DNSZombies *DNSZombieMappings
    36  }
    37  
    38  type IPCache interface {
    39  	UpsertMetadataBatch(updates ...ipcache.MU) (revision uint64)
    40  	RemoveMetadataBatch(updates ...ipcache.MU) (revision uint64)
    41  	WaitForRevision(ctx context.Context, rev uint64) error
    42  }