recorder

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: 26 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

View Source
const (
	RefreshTargetDomain = "domain"
	// RefreshTargetDomainExcludeSubDomain
	RefreshTargetSubDomain = "sub_domain"
)

Variables

View Source
var DataMissingError = errors.New("some data is missing")
View Source
var DataNotVerifiedError = errors.New("data is not verified")
View Source
var RefreshConflictError = errors.New("another operation is in progress")

Functions

This section is empty.

Types

type Cleaner

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

type Cleaners

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

func GetCleaners

func GetCleaners() *Cleaners

func (*Cleaners) Create

func (c *Cleaners) Create(orgID int)

func (*Cleaners) Delete

func (c *Cleaners) Delete(orgID int)

func (*Cleaners) Init

func (c *Cleaners) Init(ctx context.Context, cfg config.RecorderConfig)

func (*Cleaners) NewCleanerIfNotExists

func (c *Cleaners) NewCleanerIfNotExists(orgID int) (*Cleaner, error)

func (*Cleaners) Start

func (c *Cleaners) Start(sContext context.Context) error

func (*Cleaners) Stop

func (c *Cleaners) Stop()

type Recorder

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

func NewRecorder

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

func (*Recorder) GetCache

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

TODO remove

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(target string, cloudData cloudmodel.Resource) error

type Resource

type Resource struct {
	Cleaners   *Cleaners
	IDManagers *idmng.IDManagers
}

func GetResource

func GetResource() *Resource

func (*Resource) Init

Directories

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

Jump to

Keyboard shortcuts

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