ipcache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPCache

type IPCache struct {
	// contains filtered or unexported fields
}

IPCache is a mirror of Cilium's ipcache

func New

func New() *IPCache

New creates an new empty IPCache

func (*IPCache) Delete

func (ipc *IPCache) Delete(key string) bool

Delete performs a delete and returns true if an entry was deleted

func (*IPCache) GetIPIdentity

func (ipc *IPCache) GetIPIdentity(ip net.IP) (id IPIdentity, ok bool)

GetIPIdentity returns the known information about a given IP

func (*IPCache) InitializeFrom

func (ipc *IPCache) InitializeFrom(entries []*models.IPListEntry) error

InitializeFrom this IPCache instance from a list of entries obtained via Cilium API

func (*IPCache) Upsert

func (ipc *IPCache) Upsert(
	key string,
	id identity.NumericIdentity,
	hostIP net.IP,
	encryptKey uint8,
	namespace, podName string) bool

Upsert updates or inserts an entry and returns true if the update was performed.

func (*IPCache) UpsertChecked

func (ipc *IPCache) UpsertChecked(
	key string,
	newID identity.NumericIdentity,
	oldID *identity.NumericIdentity,
	newHostIP, oldHostIP net.IP,
	encryptKey uint8,
	namespace, podName string) bool

UpsertChecked performs an upsert and returns true if either an existing entry (with matching oldID and oldHostIP) was updated or if a new entry has been inserted. This is intended to be used with data obtained via Cilium monitor's `IPCacheNotification`

type IPIdentity

type IPIdentity struct {
	Identity  identity.NumericIdentity
	Namespace string
	PodName   string
}

IPIdentity contains the data associated with an IP address

Jump to

Keyboard shortcuts

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