updater

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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataGenerator

type DataGenerator[CT constraint.CloudModel, MT constraint.MySQLModel, BT constraint.DiffBase, MFUPT msg.FieldsUpdatePtr[MFUT], MFUT msg.FieldsUpdate] interface {
	// contains filtered or unexported methods
}

type IP

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

func NewIP

func NewIP(cache *cache.Cache, cloudData []cloudmodel.IP, domainToolDataSet *tool.DataSet) *IP

func (*IP) GetChanged

func (i *IP) GetChanged() bool

func (*IP) GetLANIP

func (i *IP) GetLANIP() *LANIP

func (*IP) GetResourceType

func (i *IP) GetResourceType() string

func (*IP) GetWANIP

func (i *IP) GetWANIP() *WANIP

func (*IP) HandleAddAndUpdate

func (i *IP) HandleAddAndUpdate()

func (*IP) HandleDelete

func (i *IP) HandleDelete()

type Publisher

type Publisher interface {
	GetChanged() bool
	GetResourceType() string
}

type ResourceUpdater

type ResourceUpdater interface {
	// 以资源的 lcuuid 为 key ,逐一检查 cloud 数据
	// 若 cache 的 diff base 中不存在,则添加
	// 若 cache 的 diff base 中存在,基于可更新字段,检查 cloud 数据是否发生变化,若发生变化,则更新;
	// 无论已存在资源有无变化,根据 cache 的 sequence 更新的 diff base 中的 sequence,用于标记资源是否需要被删除
	HandleAddAndUpdate()
	// 逐一检查 diff base 中的资源,若 sequence 不等于 cache 中的 sequence,则删除
	HandleDelete()

	Publisher
}

ResourceUpdater 实现资源进行新旧数据比对,并根据比对结果增删改资源

type UpdaterBase

type UpdaterBase[
	CT constraint.CloudModel,
	BT constraint.DiffBase,
	MPT constraint.MySQLModelPtr[MT],
	MT constraint.MySQLModel,
	MAPT msg.AddPtr[MAT],
	MAT msg.Add,
	MUPT msg.UpdatePtr[MUT],
	MUT msg.Update,
	MFUPT msg.FieldsUpdatePtr[MFUT],
	MFUT msg.FieldsUpdate,
	MDPT msg.DeletePtr[MDT],
	MDT msg.Delete,
] struct {

	// Set Changed to true if the resource database and cache are updated,
	// used for cache update notifications to trisolaris module.
	Changed bool
	// contains filtered or unexported fields
}

func (*UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) GetChanged

func (u *UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) GetChanged() bool

func (*UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) GetResourceType

func (u *UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) GetResourceType() string

func (*UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) HandleAddAndUpdate

func (u *UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) HandleAddAndUpdate()

func (*UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) HandleDelete

func (u *UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) HandleDelete()

func (*UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) RegisterListener

func (u *UpdaterBase[CT, BT, MPT, MT, MAPT, MAT, MUPT, MUT, MFUPT, MFUT, MDPT, MDT]) RegisterListener(listener listener.Listener[CT, MT, BT]) ResourceUpdater

Jump to

Keyboard shortcuts

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