cache

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefreshSignalCallerSelfHeal  = "self_heal"
	RefreshSignalCallerDomain    = "domain"
	RefreshSignalCallerSubDomain = "sub_domain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	SelfHealInterval time.Duration
	RefreshSignal    chan struct{} // 用于限制并发刷新
	Sequence         int           // 缓存的序列标识,根据刷新递增;为debug方便,设置为公有属性,需避免直接修改值,使用接口修改

	DiffBaseDataSet *diffbase.DataSet
	ToolDataSet     *tool.DataSet
	// contains filtered or unexported fields
}

func NewCache

func NewCache(ctx context.Context, md *rcommon.Metadata, selfHealInterval time.Duration) *Cache

func (*Cache) AddAZ

func (c *Cache) AddAZ(item *mysqlmodel.AZ)

func (*Cache) AddAZs

func (c *Cache) AddAZs(items []*mysqlmodel.AZ)

func (*Cache) AddCENs

func (c *Cache) AddCENs(items []*mysqlmodel.CEN)

func (*Cache) AddDHCPPorts

func (c *Cache) AddDHCPPorts(items []*mysqlmodel.DHCPPort)

func (*Cache) AddFloatingIPs

func (c *Cache) AddFloatingIPs(items []*mysqlmodel.FloatingIP)

func (*Cache) AddHost

func (c *Cache) AddHost(item *mysqlmodel.Host)

func (*Cache) AddHosts

func (c *Cache) AddHosts(items []*mysqlmodel.Host)

func (*Cache) AddLANIPs

func (c *Cache) AddLANIPs(items []*mysqlmodel.LANIP)

func (*Cache) AddLBListeners

func (c *Cache) AddLBListeners(items []*mysqlmodel.LBListener)

func (*Cache) AddLBTargetServers

func (c *Cache) AddLBTargetServers(items []*mysqlmodel.LBTargetServer)

func (*Cache) AddLBVMConnections

func (c *Cache) AddLBVMConnections(items []*mysqlmodel.LBVMConnection)

func (*Cache) AddLBs

func (c *Cache) AddLBs(items []*mysqlmodel.LB)

func (*Cache) AddNATGateways

func (c *Cache) AddNATGateways(items []*mysqlmodel.NATGateway)

func (*Cache) AddNATRules

func (c *Cache) AddNATRules(items []*mysqlmodel.NATRule)

func (*Cache) AddNATVMConnections

func (c *Cache) AddNATVMConnections(items []*mysqlmodel.NATVMConnection)

func (*Cache) AddNetwork

func (c *Cache) AddNetwork(item *mysqlmodel.Network)

func (*Cache) AddNetworks

func (c *Cache) AddNetworks(items []*mysqlmodel.Network)

func (*Cache) AddPeerConnections

func (c *Cache) AddPeerConnections(items []*mysqlmodel.PeerConnection)

func (*Cache) AddPodClusters

func (c *Cache) AddPodClusters(items []*mysqlmodel.PodCluster)

func (*Cache) AddPodGroupPorts

func (c *Cache) AddPodGroupPorts(items []*mysqlmodel.PodGroupPort)

func (*Cache) AddPodGroups

func (c *Cache) AddPodGroups(items []*mysqlmodel.PodGroup)

func (*Cache) AddPodIngress

func (c *Cache) AddPodIngress(item *mysqlmodel.PodIngress)

func (*Cache) AddPodIngressRuleBackends

func (c *Cache) AddPodIngressRuleBackends(items []*mysqlmodel.PodIngressRuleBackend)

func (*Cache) AddPodIngressRules

func (c *Cache) AddPodIngressRules(items []*mysqlmodel.PodIngressRule)

func (*Cache) AddPodIngresses

func (c *Cache) AddPodIngresses(items []*mysqlmodel.PodIngress)

func (*Cache) AddPodNamespaces

func (c *Cache) AddPodNamespaces(items []*mysqlmodel.PodNamespace)

func (*Cache) AddPodNodes

func (c *Cache) AddPodNodes(items []*mysqlmodel.PodNode)

func (*Cache) AddPodReplicaSets

func (c *Cache) AddPodReplicaSets(items []*mysqlmodel.PodReplicaSet)

func (*Cache) AddPodService

func (c *Cache) AddPodService(item *mysqlmodel.PodService)

func (*Cache) AddPodServicePorts

func (c *Cache) AddPodServicePorts(items []*mysqlmodel.PodServicePort)

func (*Cache) AddPodServices

func (c *Cache) AddPodServices(items []*mysqlmodel.PodService)

func (*Cache) AddPods

func (c *Cache) AddPods(items []*mysqlmodel.Pod)

func (*Cache) AddProcesses

func (c *Cache) AddProcesses(items []*mysqlmodel.Process)

func (*Cache) AddRDSInstances

func (c *Cache) AddRDSInstances(items []*mysqlmodel.RDSInstance)

func (*Cache) AddRedisInstances

func (c *Cache) AddRedisInstances(items []*mysqlmodel.RedisInstance)

func (*Cache) AddRegion

func (c *Cache) AddRegion(item *mysqlmodel.Region)

func (*Cache) AddRegions

func (c *Cache) AddRegions(items []*mysqlmodel.Region)

func (*Cache) AddRoutingTables

func (c *Cache) AddRoutingTables(items []*mysqlmodel.RoutingTable)

func (*Cache) AddSubDomain

func (c *Cache) AddSubDomain(item *mysqlmodel.SubDomain)

func (*Cache) AddSubDomains

func (c *Cache) AddSubDomains(items []*mysqlmodel.SubDomain)

func (*Cache) AddSubnets

func (c *Cache) AddSubnets(items []*mysqlmodel.Subnet)

func (*Cache) AddVIPs

func (c *Cache) AddVIPs(items []*mysqlmodel.VIP)

func (*Cache) AddVInterfaces

func (c *Cache) AddVInterfaces(items []*mysqlmodel.VInterface)

func (*Cache) AddVM

func (c *Cache) AddVM(item *mysqlmodel.VM)

func (*Cache) AddVMPodNodeConnections

func (c *Cache) AddVMPodNodeConnections(items []*mysqlmodel.VMPodNodeConnection)

func (*Cache) AddVMs

func (c *Cache) AddVMs(items []*mysqlmodel.VM)

func (*Cache) AddVPCs

func (c *Cache) AddVPCs(items []*mysqlmodel.VPC)

func (*Cache) AddVRouter

func (c *Cache) AddVRouter(item *mysqlmodel.VRouter)

func (*Cache) AddVRouters

func (c *Cache) AddVRouters(items []*mysqlmodel.VRouter)

func (*Cache) AddWANIPs

func (c *Cache) AddWANIPs(items []*mysqlmodel.WANIP)

func (*Cache) DeleteAZ

func (c *Cache) DeleteAZ(lcuuid string)

func (*Cache) DeleteAZs

func (c *Cache) DeleteAZs(lcuuids []string)

func (*Cache) DeleteCENs

func (c *Cache) DeleteCENs(lcuuids []string)

func (*Cache) DeleteDHCPPorts

func (c *Cache) DeleteDHCPPorts(lcuuids []string)

func (*Cache) DeleteFloatingIPs

func (c *Cache) DeleteFloatingIPs(lcuuids []string)

func (*Cache) DeleteHost

func (c *Cache) DeleteHost(lcuuid string)

func (*Cache) DeleteHosts

func (c *Cache) DeleteHosts(lcuuids []string)

func (*Cache) DeleteLANIPs

func (c *Cache) DeleteLANIPs(lcuuids []string)

func (*Cache) DeleteLBListeners

func (c *Cache) DeleteLBListeners(lcuuids []string)

func (*Cache) DeleteLBTargetServers

func (c *Cache) DeleteLBTargetServers(lcuuids []string)

func (*Cache) DeleteLBVMConnections

func (c *Cache) DeleteLBVMConnections(lcuuids []string)

func (*Cache) DeleteLBs

func (c *Cache) DeleteLBs(lcuuids []string)

func (*Cache) DeleteNATGateways

func (c *Cache) DeleteNATGateways(lcuuids []string)

func (*Cache) DeleteNATRules

func (c *Cache) DeleteNATRules(lcuuids []string)

func (*Cache) DeleteNATVMConnections

func (c *Cache) DeleteNATVMConnections(lcuuids []string)

func (*Cache) DeleteNetworks

func (c *Cache) DeleteNetworks(lcuuids []string)

func (*Cache) DeletePeerConnections

func (c *Cache) DeletePeerConnections(lcuuids []string)

func (*Cache) DeletePodClusters

func (c *Cache) DeletePodClusters(lcuuids []string)

func (*Cache) DeletePodGroupPorts

func (c *Cache) DeletePodGroupPorts(lcuuids []string)

func (*Cache) DeletePodGroups

func (c *Cache) DeletePodGroups(lcuuids []string)

func (*Cache) DeletePodIngressRuleBackends

func (c *Cache) DeletePodIngressRuleBackends(lcuuids []string)

func (*Cache) DeletePodIngressRules

func (c *Cache) DeletePodIngressRules(lcuuids []string)

func (*Cache) DeletePodIngresses

func (c *Cache) DeletePodIngresses(lcuuids []string)

func (*Cache) DeletePodNamespaces

func (c *Cache) DeletePodNamespaces(lcuuids []string)

func (*Cache) DeletePodNodes

func (c *Cache) DeletePodNodes(lcuuids []string)

func (*Cache) DeletePodReplicaSets

func (c *Cache) DeletePodReplicaSets(lcuuids []string)

func (*Cache) DeletePodServicePorts

func (c *Cache) DeletePodServicePorts(lcuuids []string)

func (*Cache) DeletePodServices

func (c *Cache) DeletePodServices(lcuuids []string)

func (*Cache) DeletePods

func (c *Cache) DeletePods(lcuuids []string)

func (*Cache) DeleteProcesses

func (c *Cache) DeleteProcesses(lcuuids []string)

func (*Cache) DeleteRDSInstances

func (c *Cache) DeleteRDSInstances(lcuuids []string)

func (*Cache) DeleteRedisInstances

func (c *Cache) DeleteRedisInstances(lcuuids []string)

func (*Cache) DeleteRegion

func (c *Cache) DeleteRegion(lcuuid string)

func (*Cache) DeleteRegions

func (c *Cache) DeleteRegions(lcuuids []string)

func (*Cache) DeleteRoutingTables

func (c *Cache) DeleteRoutingTables(lcuuids []string)

func (*Cache) DeleteSubDomain

func (c *Cache) DeleteSubDomain(lcuuid string)

func (*Cache) DeleteSubDomains

func (c *Cache) DeleteSubDomains(lcuuids []string)

func (*Cache) DeleteSubnets

func (c *Cache) DeleteSubnets(lcuuids []string)

func (*Cache) DeleteVIPs

func (c *Cache) DeleteVIPs(lcuuids []string)

func (*Cache) DeleteVInterfaces

func (c *Cache) DeleteVInterfaces(lcuuids []string)

func (*Cache) DeleteVM

func (c *Cache) DeleteVM(lcuuid string)

func (*Cache) DeleteVMPodNodeConnections

func (c *Cache) DeleteVMPodNodeConnections(lcuuids []string)

func (*Cache) DeleteVMs

func (c *Cache) DeleteVMs(lcuuids []string)

func (*Cache) DeleteVPCs

func (c *Cache) DeleteVPCs(lcuuids []string)

func (*Cache) DeleteVRouters

func (c *Cache) DeleteVRouters(lcuuids []string)

func (*Cache) DeleteWANIPs

func (c *Cache) DeleteWANIPs(lcuuids []string)

func (*Cache) GetMetadata

func (c *Cache) GetMetadata() *rcommon.Metadata

func (*Cache) GetSequence

func (c *Cache) GetSequence() int

func (*Cache) IncrementSequence

func (c *Cache) IncrementSequence()

func (*Cache) Refresh

func (c *Cache) Refresh()

所有缓存的刷新入口

func (*Cache) ResetRefreshSignal

func (c *Cache) ResetRefreshSignal(caller string)

func (*Cache) SetLogLevel

func (c *Cache) SetLogLevel(level logging.Level, caller string)

func (*Cache) SetSequence

func (c *Cache) SetSequence(sequence int)

func (*Cache) StartSelfHealing

func (c *Cache) StartSelfHealing()

func (*Cache) TryRefresh

func (c *Cache) TryRefresh() bool

func (*Cache) UpdateDHCPPort

func (c *Cache) UpdateDHCPPort(cloudItem *cloudmodel.DHCPPort)

func (*Cache) UpdateHost

func (c *Cache) UpdateHost(cloudItem *cloudmodel.Host)

func (*Cache) UpdateLB

func (c *Cache) UpdateLB(cloudItem *cloudmodel.LB)

func (*Cache) UpdateNATGateway

func (c *Cache) UpdateNATGateway(cloudItem *cloudmodel.NATGateway)

func (*Cache) UpdateNetwork

func (c *Cache) UpdateNetwork(cloudItem *cloudmodel.Network)

func (*Cache) UpdatePod

func (c *Cache) UpdatePod(cloudItem *cloudmodel.Pod)

func (*Cache) UpdatePodNode

func (c *Cache) UpdatePodNode(cloudItem *cloudmodel.PodNode)

func (*Cache) UpdatePodService

func (c *Cache) UpdatePodService(cloudItem *cloudmodel.PodService)

func (*Cache) UpdateRDSInstance

func (c *Cache) UpdateRDSInstance(cloudItem *cloudmodel.RDSInstance)

func (*Cache) UpdateRedisInstance

func (c *Cache) UpdateRedisInstance(cloudItem *cloudmodel.RedisInstance)

func (*Cache) UpdateVInterface

func (c *Cache) UpdateVInterface(cloudItem *cloudmodel.VInterface)

func (*Cache) UpdateVM

func (c *Cache) UpdateVM(cloudItem *cloudmodel.VM)

func (*Cache) UpdateVRouter

func (c *Cache) UpdateVRouter(cloudItem *cloudmodel.VRouter)

type CacheManager

type CacheManager struct {
	DomainCache       *Cache
	SubDomainCacheMap map[string]*Cache
	// contains filtered or unexported fields
}

为支持domain及其sub_domain的独立刷新,将缓存拆分成对应的独立Cache

func NewCacheManager

func NewCacheManager(ctx context.Context, cfg config.RecorderConfig, md *rcommon.Metadata) *CacheManager

func (*CacheManager) CreateSubDomainCacheIfNotExists

func (m *CacheManager) CreateSubDomainCacheIfNotExists(md *rcommon.Metadata) *Cache

type LogController

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

func (*LogController) GetLogFunc

func (l *LogController) GetLogFunc() func(args ...interface{})

func (*LogController) SetLogLevel

func (l *LogController) SetLogLevel(level logging.Level) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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