recorder

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

代码架构

cache

各类资源缓存数据,定时基于mysql刷新数据,达到自愈效果。

  • diff_base
    • 所有资源的主要信息,用于与cloud数据比较差异,根据差异更新资源。
  • tool_map
    • 资源的映射关联关系,用于刷新资源时,转换所需数据。
updater

比较cloud数据与cache的差异,根据结果进行db、cache、资源变更事件增删改操作。

db

提供对资源的增删改操作。

Documentation

Overview

永久删除MySQL中超过7天的软删除云平台资源数据

提供获取recorder内部数据的debug接口

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

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

func GetSingletonCleaner

func GetSingletonCleaner() *Cleaner

func (*Cleaner) Init

func (c *Cleaner) Init(cfg *RecorderConfig)

func (*Cleaner) Start

func (c *Cleaner) Start()

func (*Cleaner) Stop

func (c *Cleaner) Stop()

type Recorder

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

func NewRecorder

func NewRecorder(domainLcuuid, domainName string, cfg config.RecorderConfig, ctx context.Context, eventQueue *queue.OverwriteQueue) *Recorder

func (*Recorder) GetCache

func (r *Recorder) GetCache(domainLcuuid, subDomainLcuuid string) cache.Cache

func (*Recorder) GetCacheDiffBase

func (r *Recorder) GetCacheDiffBase(domainLcuuid, subDomainLcuuid, resourceType, resourceLcuuid string) interface{}

func (*Recorder) GetCacheDiffBaseDataSet

func (r *Recorder) GetCacheDiffBaseDataSet(domainLcuuid, subDomainLcuuid, resourceType string) map[string]interface{}

func (*Recorder) GetToolMap

func (r *Recorder) GetToolMap(domainLcuuid, subDomainLcuuid, field string) map[interface{}]interface{}

func (*Recorder) Refresh

func (r *Recorder) Refresh(cloudData cloudmodel.Resource)

recorder 同步数据功能入口

func (*Recorder) Start

func (r *Recorder) Start()

recorder 开始,启动一个刷新 cache 的定时任务,保证 cache 能够在数据异常后自动恢复

type Resource

type Resource struct {
	Cleaner   *Cleaner
	IDManager *idmng.IDManager
}

func GetSingletonResource

func GetSingletonResource() *Resource

func (*Resource) Init

func (r *Resource) Init(cfg *config.RecorderConfig) *Resource

Directories

Path Synopsis
recorder包中使用到的泛型约束
recorder包中使用到的泛型约束
db

Jump to

Keyboard shortcuts

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