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

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package proxy
     5  
     6  import (
     7  	"github.com/cilium/cilium/pkg/endpoint"
     8  	"github.com/cilium/cilium/pkg/fqdn/restore"
     9  	"github.com/cilium/cilium/pkg/policy"
    10  )
    11  
    12  type DNSProxier interface {
    13  	GetRules(uint16) (restore.DNSRules, error)
    14  	RemoveRestoredRules(uint16)
    15  	UpdateAllowed(endpointID uint64, destPort restore.PortProto, newRules policy.L7DataMap) error
    16  	GetBindPort() uint16
    17  	SetRejectReply(string)
    18  	RestoreRules(op *endpoint.Endpoint)
    19  	Cleanup()
    20  }
    21  
    22  type MockFQDNProxy struct{}
    23  
    24  func (m MockFQDNProxy) GetRules(u uint16) (restore.DNSRules, error) {
    25  	return nil, nil
    26  }
    27  
    28  func (m MockFQDNProxy) RemoveRestoredRules(u uint16) {
    29  }
    30  
    31  func (m MockFQDNProxy) UpdateAllowed(endpointID uint64, destPort restore.PortProto, newRules policy.L7DataMap) error {
    32  	return nil
    33  }
    34  
    35  func (m MockFQDNProxy) GetBindPort() uint16 {
    36  	return 0
    37  }
    38  
    39  func (m MockFQDNProxy) SetRejectReply(s string) {
    40  }
    41  
    42  func (m MockFQDNProxy) RestoreRules(op *endpoint.Endpoint) {
    43  }
    44  
    45  func (m MockFQDNProxy) Cleanup() {
    46  }