datacollection

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisDisKeyPrefix         = common.BKCacheKeyV3Prefix + "discover:"
	MasterProcLockKey         = common.BKCacheKeyV3Prefix + "snapshot:masterlock"
	MasterDisLockKey          = common.BKCacheKeyV3Prefix + "discover:masterlock"
	RedisSnapKeyChannelStatus = common.BKCacheKeyV3Prefix + "snapshot:channelstatus"
)
View Source
const (
	MaxSnapSize     = 2000
	MaxDiscoverSize = 1000
)
View Source
const (
	DiscoverChan = "discover"
	SnapShotChan = "snapshot"
)
View Source
const MOCKMSG = "" /* 7086-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	ID            int    `json:"id"`
	OwnerID       string `json:"bk_supplier_account"`
	ObjID         string `json:"bk_obj_id"`
	PropertyGroup string `json:"bk_property_group"`

	PropertyID    string `json:"bk_property_id"`
	PropertyName  string `json:"bk_property_name"`
	PropertyType  string `json:"bk_property_type"`
	AssociationID string `json:"bk_asst_obj_id"`

	Option  interface{} `json:"option"`
	Creator string      `json:"creator"`

	Editable    bool   `json:"editable"`
	IsRequired  bool   `json:"isrequired"`
	IsReadOnly  bool   `json:"isreadonly"`
	IsOnly      bool   `json:"isonly"`
	Description string `json:"description"`
}

type Cache

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

type DataCollection

type DataCollection struct {
	Config *options.Config
	*backbone.Engine
	// contains filtered or unexported fields
}

func NewDataCollection

func NewDataCollection(config *options.Config, backbone *backbone.Engine) *DataCollection

func (*DataCollection) Run

func (d *DataCollection) Run() error

type DetailResult

type DetailResult struct {
	ResultBase
	Data struct {
		Count int       `json:"count"`
		Info  []MapData `json:"info"`
	} `json:"data"`
}

type Discover

type Discover struct {
	sync.Mutex

	*backbone.Engine
	// contains filtered or unexported fields
}

func NewDiscover

func NewDiscover(ctx context.Context, chanName string, maxSize int, redisCli, subCli *redis.Client, backbone *backbone.Engine) *Discover

func (*Discover) CreateModelAttrKey

func (d *Discover) CreateModelAttrKey(model Model, ownerID string) string

func (*Discover) CreateModelKey

func (d *Discover) CreateModelKey(model Model, ownerID string) string

func (*Discover) GetAttrs

func (d *Discover) GetAttrs(ownerID, objID, modelAttrKey string, attrs map[string]metadata.ObjAttDes) ([]metadata.Attribute, error)

func (*Discover) GetInst

func (d *Discover) GetInst(ownerID, objID string, keys []string, instKey string) (map[string]interface{}, error)

func (*Discover) GetInstFromRedis

func (d *Discover) GetInstFromRedis(instKey string) (map[string]interface{}, error)

func (*Discover) GetModel

func (d *Discover) GetModel(model Model, ownerID string) (bool, error)

func (*Discover) GetModelAttrsFromRedis

func (d *Discover) GetModelAttrsFromRedis(modelAttrKey string) ([]string, error)

func (*Discover) GetModelFromRedis

func (d *Discover) GetModelFromRedis(modelKey string) (MapData, error)

func (*Discover) Run

func (d *Discover) Run()

func (*Discover) Start

func (d *Discover) Start()

func (*Discover) TryCreateModel

func (d *Discover) TryCreateModel(msg string) error

func (*Discover) TrySetRedis

func (d *Discover) TrySetRedis(key string, value []byte, duration time.Duration)

func (*Discover) TryUnsetRedis

func (d *Discover) TryUnsetRedis(key string)

func (*Discover) UpdateOrAppendAttrs

func (d *Discover) UpdateOrAppendAttrs(msg string) error

func (*Discover) UpdateOrCreateInst

func (d *Discover) UpdateOrCreateInst(msg string) error

type HostCache

type HostCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type HostInst

type HostInst struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type HostSnap

type HostSnap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewHostSnap

func NewHostSnap(chanName []string, maxSize int, redisCli, snapCli *redis.Client, db storage.DI) *HostSnap

func (*HostSnap) Run

func (h *HostSnap) Run()

func (*HostSnap) Start

func (h *HostSnap) Start()

type ListResult

type ListResult struct {
	ResultBase
	Data []MapData `json:"data"`
}

type M

type M map[string]interface{}

func (M) Keys

func (m M) Keys() (keys []string)

type MapData

type MapData M

type Model

type Model struct {
	BkClassificationID string `json:"bk_classification_id"`
	BkObjID            string `json:"bk_obj_id"`
	BkObjName          string `json:"bk_obj_name"`
	Keys               string `json:"bk_obj_keys"`
}
type Related struct {
	BkInstId   int    `json:"bk_inst_id"`
	BkInstName string `json:"bk_inst_name"`
	BkObjIcon  string `json:"bk_obj_icon"`
	BkObjId    string `json:"bk_obj_id"`
	BkObjName  string `json:"bk_obj_name"`
	Id         string `json:"id"`
}

type Result

type Result struct {
	ResultBase
	Data interface{} `json:"data"`
}

type ResultBase

type ResultBase struct {
	Result  bool   `json:"result"`
	Code    int    `json:"bk_error_code"`
	Message string `json:"bk_err_message"`
}

type SingleRelated

type SingleRelated []Related

Jump to

Keyboard shortcuts

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