options

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TriggerTimeTypeTiming   = "timing"
	TriggerTimeTypeInterval = "interval"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Names []string

	ConifgItemArray []*ConfigItem
	Trigger         TriggerTime
	// contains filtered or unexported fields
}

Config config file set

type ConfigItem

type ConfigItem struct {
	Name string
	// White list, default false
	WhiteList bool
	// White list  = true, need synchronize app list
	// White list  = true,  out of synchronize business name,
	AppNames []string

	// ObjectID array source
	ObjectIDArr []string
	// resource pool sync config
	SyncResource bool

	// TargetHost target data logics
	TargetHost string

	// FieldSign source data fields
	FieldSign string

	// SynchronizeFlag current server data synchronize flag
	SynchronizeFlag string

	//SupplerAccount string
	SupplerAccount []string

	// Retry error max retry count
	ExceptionFileCount int

	// Unsynchronized model related properties
	// 使用忽略模型属性变的模式。 用户在目标中新加对应的模型,模型的属性。
	// 满足同步的实例将会同步到目的cmdb。 在目标系统中新建相同的唯一标识模型或者模型的字段。内容会自动展示出来
	IgnoreModelAttr bool

	// EnableInstFilter  是否开启实例数据根据同步身份过滤
	EnableInstFilter bool
	// contains filtered or unexported fields
}

ConfigItem config item info

type ServerOption

type ServerOption struct {
	ServConf *config.CCAPIConfig
}

ServerOption define option of server in flags

func NewServerOption

func NewServerOption() *ServerOption

NewServerOption create a ServerOption object

func (*ServerOption) AddFlags

func (s *ServerOption) AddFlags(fs *pflag.FlagSet)

AddFlags add flags

type TriggerTime

type TriggerTime struct {
	// timing, interval , default value timing
	TriggerType string
	Role        string
}

TriggerTime define synchronize task trigger style and role

func (TriggerTime) IsTiming

func (t TriggerTime) IsTiming() bool

IsTiming judge is timing trigger

Jump to

Keyboard shortcuts

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